OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. | 509 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. |
510 m_pendingActionFlags |= LoadMediaResource; | 510 m_pendingActionFlags |= LoadMediaResource; |
511 m_loadTimer.startOneShot(0, FROM_HERE); | 511 m_loadTimer.startOneShot(0, FROM_HERE); |
512 } | 512 } |
513 | 513 |
514 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) | 514 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) |
515 { | 515 { |
516 scheduleEvent(Event::createCancelable(eventName)); | 516 scheduleEvent(Event::createCancelable(eventName)); |
517 } | 517 } |
518 | 518 |
519 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) | 519 void HTMLMediaElement::scheduleEvent(PassRefPtrWillBeRawPtr<Event> event) |
520 { | 520 { |
521 #if LOG_MEDIA_EVENTS | 521 #if LOG_MEDIA_EVENTS |
522 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", event->t
ype().ascii().data()); | 522 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", event->t
ype().ascii().data()); |
523 #endif | 523 #endif |
524 m_asyncEventQueue->enqueueEvent(event); | 524 m_asyncEventQueue->enqueueEvent(event); |
525 } | 525 } |
526 | 526 |
527 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*) | 527 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*) |
528 { | 528 { |
529 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L
oadTextTrackResource)) | 529 if (RuntimeEnabledFeatures::videoTrackEnabled() && (m_pendingActionFlags & L
oadTextTrackResource)) |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 | 1087 |
1088 // 12 - Sort the tasks in events in ascending time order (tasks with earlier | 1088 // 12 - Sort the tasks in events in ascending time order (tasks with earlier |
1089 // times first). | 1089 // times first). |
1090 nonCopyingSort(eventTasks.begin(), eventTasks.end(), eventTimeCueCompare); | 1090 nonCopyingSort(eventTasks.begin(), eventTasks.end(), eventTimeCueCompare); |
1091 | 1091 |
1092 for (size_t i = 0; i < eventTasks.size(); ++i) { | 1092 for (size_t i = 0; i < eventTasks.size(); ++i) { |
1093 if (!affectedTracks.contains(eventTasks[i].second->track())) | 1093 if (!affectedTracks.contains(eventTasks[i].second->track())) |
1094 affectedTracks.append(eventTasks[i].second->track()); | 1094 affectedTracks.append(eventTasks[i].second->track()); |
1095 | 1095 |
1096 // 13 - Queue each task in events, in list order. | 1096 // 13 - Queue each task in events, in list order. |
1097 RefPtr<Event> event; | 1097 RefPtrWillBeRawPtr<Event> event; |
1098 | 1098 |
1099 // Each event in eventTasks may be either an enterEvent or an exitEvent, | 1099 // Each event in eventTasks may be either an enterEvent or an exitEvent, |
1100 // depending on the time that is associated with the event. This | 1100 // depending on the time that is associated with the event. This |
1101 // correctly identifies the type of the event, if the startTime is | 1101 // correctly identifies the type of the event, if the startTime is |
1102 // less than the endTime in the cue. | 1102 // less than the endTime in the cue. |
1103 if (eventTasks[i].second->startTime() >= eventTasks[i].second->endTime()
) { | 1103 if (eventTasks[i].second->startTime() >= eventTasks[i].second->endTime()
) { |
1104 event = Event::create(EventTypeNames::enter); | 1104 event = Event::create(EventTypeNames::enter); |
1105 event->setTarget(eventTasks[i].second); | 1105 event->setTarget(eventTasks[i].second); |
1106 m_asyncEventQueue->enqueueEvent(event.release()); | 1106 m_asyncEventQueue->enqueueEvent(event.release()); |
1107 | 1107 |
(...skipping 11 matching lines...) Expand all Loading... |
1119 } | 1119 } |
1120 } | 1120 } |
1121 | 1121 |
1122 // 14 - Sort affected tracks in the same order as the text tracks appear in | 1122 // 14 - Sort affected tracks in the same order as the text tracks appear in |
1123 // the media element's list of text tracks, and remove duplicates. | 1123 // the media element's list of text tracks, and remove duplicates. |
1124 nonCopyingSort(affectedTracks.begin(), affectedTracks.end(), trackIndexCompa
re); | 1124 nonCopyingSort(affectedTracks.begin(), affectedTracks.end(), trackIndexCompa
re); |
1125 | 1125 |
1126 // 15 - For each text track in affected tracks, in the list order, queue a | 1126 // 15 - For each text track in affected tracks, in the list order, queue a |
1127 // task to fire a simple event named cuechange at the TextTrack object, and,
... | 1127 // task to fire a simple event named cuechange at the TextTrack object, and,
... |
1128 for (size_t i = 0; i < affectedTracks.size(); ++i) { | 1128 for (size_t i = 0; i < affectedTracks.size(); ++i) { |
1129 RefPtr<Event> event = Event::create(EventTypeNames::cuechange); | 1129 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::cuechang
e); |
1130 event->setTarget(affectedTracks[i]); | 1130 event->setTarget(affectedTracks[i]); |
1131 | 1131 |
1132 m_asyncEventQueue->enqueueEvent(event.release()); | 1132 m_asyncEventQueue->enqueueEvent(event.release()); |
1133 | 1133 |
1134 // ... if the text track has a corresponding track element, to then fire
a | 1134 // ... if the text track has a corresponding track element, to then fire
a |
1135 // simple event named cuechange at the track element as well. | 1135 // simple event named cuechange at the track element as well. |
1136 if (affectedTracks[i]->trackType() == TextTrack::TrackElement) { | 1136 if (affectedTracks[i]->trackType() == TextTrack::TrackElement) { |
1137 RefPtr<Event> event = Event::create(EventTypeNames::cuechange); | 1137 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::cuec
hange); |
1138 HTMLTrackElement* trackElement = static_cast<LoadableTextTrack*>(aff
ectedTracks[i])->trackElement(); | 1138 HTMLTrackElement* trackElement = static_cast<LoadableTextTrack*>(aff
ectedTracks[i])->trackElement(); |
1139 ASSERT(trackElement); | 1139 ASSERT(trackElement); |
1140 event->setTarget(trackElement); | 1140 event->setTarget(trackElement); |
1141 | 1141 |
1142 m_asyncEventQueue->enqueueEvent(event.release()); | 1142 m_asyncEventQueue->enqueueEvent(event.release()); |
1143 } | 1143 } |
1144 } | 1144 } |
1145 | 1145 |
1146 // 16 - Set the text track cue active flag of all the cues in the current | 1146 // 16 - Set the text track cue active flag of all the cues in the current |
1147 // cues, and unset the text track cue active flag of all the cues in the | 1147 // cues, and unset the text track cue active flag of all the cues in the |
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3654 { | 3654 { |
3655 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 3655 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
3656 } | 3656 } |
3657 | 3657 |
3658 bool HTMLMediaElement::isInteractiveContent() const | 3658 bool HTMLMediaElement::isInteractiveContent() const |
3659 { | 3659 { |
3660 return fastHasAttribute(controlsAttr); | 3660 return fastHasAttribute(controlsAttr); |
3661 } | 3661 } |
3662 | 3662 |
3663 } | 3663 } |
OLD | NEW |