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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. | 506 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. |
507 m_pendingActionFlags |= LoadMediaResource; | 507 m_pendingActionFlags |= LoadMediaResource; |
508 m_loadTimer.startOneShot(0, FROM_HERE); | 508 m_loadTimer.startOneShot(0, FROM_HERE); |
509 } | 509 } |
510 | 510 |
511 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) | 511 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) |
512 { | 512 { |
513 scheduleEvent(Event::createCancelable(eventName)); | 513 scheduleEvent(Event::createCancelable(eventName)); |
514 } | 514 } |
515 | 515 |
516 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) | 516 void HTMLMediaElement::scheduleEvent(PassRefPtrWillBeRawPtr<Event> event) |
517 { | 517 { |
518 #if LOG_MEDIA_EVENTS | 518 #if LOG_MEDIA_EVENTS |
519 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", event->t
ype().ascii().data()); | 519 WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", event->t
ype().ascii().data()); |
520 #endif | 520 #endif |
521 m_asyncEventQueue->enqueueEvent(event); | 521 m_asyncEventQueue->enqueueEvent(event); |
522 } | 522 } |
523 | 523 |
524 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*) | 524 void HTMLMediaElement::loadTimerFired(Timer<HTMLMediaElement>*) |
525 { | 525 { |
526 if (m_pendingActionFlags & LoadTextTrackResource) | 526 if (m_pendingActionFlags & LoadTextTrackResource) |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 | 1081 |
1082 // 12 - Sort the tasks in events in ascending time order (tasks with earlier | 1082 // 12 - Sort the tasks in events in ascending time order (tasks with earlier |
1083 // times first). | 1083 // times first). |
1084 nonCopyingSort(eventTasks.begin(), eventTasks.end(), eventTimeCueCompare); | 1084 nonCopyingSort(eventTasks.begin(), eventTasks.end(), eventTimeCueCompare); |
1085 | 1085 |
1086 for (size_t i = 0; i < eventTasks.size(); ++i) { | 1086 for (size_t i = 0; i < eventTasks.size(); ++i) { |
1087 if (!affectedTracks.contains(eventTasks[i].second->track())) | 1087 if (!affectedTracks.contains(eventTasks[i].second->track())) |
1088 affectedTracks.append(eventTasks[i].second->track()); | 1088 affectedTracks.append(eventTasks[i].second->track()); |
1089 | 1089 |
1090 // 13 - Queue each task in events, in list order. | 1090 // 13 - Queue each task in events, in list order. |
1091 RefPtr<Event> event; | 1091 RefPtrWillBeRawPtr<Event> event = nullptr; |
1092 | 1092 |
1093 // Each event in eventTasks may be either an enterEvent or an exitEvent, | 1093 // Each event in eventTasks may be either an enterEvent or an exitEvent, |
1094 // depending on the time that is associated with the event. This | 1094 // depending on the time that is associated with the event. This |
1095 // correctly identifies the type of the event, if the startTime is | 1095 // correctly identifies the type of the event, if the startTime is |
1096 // less than the endTime in the cue. | 1096 // less than the endTime in the cue. |
1097 if (eventTasks[i].second->startTime() >= eventTasks[i].second->endTime()
) { | 1097 if (eventTasks[i].second->startTime() >= eventTasks[i].second->endTime()
) { |
1098 event = Event::create(EventTypeNames::enter); | 1098 event = Event::create(EventTypeNames::enter); |
1099 event->setTarget(eventTasks[i].second); | 1099 event->setTarget(eventTasks[i].second); |
1100 m_asyncEventQueue->enqueueEvent(event.release()); | 1100 m_asyncEventQueue->enqueueEvent(event.release()); |
1101 | 1101 |
(...skipping 11 matching lines...) Expand all Loading... |
1113 } | 1113 } |
1114 } | 1114 } |
1115 | 1115 |
1116 // 14 - Sort affected tracks in the same order as the text tracks appear in | 1116 // 14 - Sort affected tracks in the same order as the text tracks appear in |
1117 // the media element's list of text tracks, and remove duplicates. | 1117 // the media element's list of text tracks, and remove duplicates. |
1118 nonCopyingSort(affectedTracks.begin(), affectedTracks.end(), trackIndexCompa
re); | 1118 nonCopyingSort(affectedTracks.begin(), affectedTracks.end(), trackIndexCompa
re); |
1119 | 1119 |
1120 // 15 - For each text track in affected tracks, in the list order, queue a | 1120 // 15 - For each text track in affected tracks, in the list order, queue a |
1121 // task to fire a simple event named cuechange at the TextTrack object, and,
... | 1121 // task to fire a simple event named cuechange at the TextTrack object, and,
... |
1122 for (size_t i = 0; i < affectedTracks.size(); ++i) { | 1122 for (size_t i = 0; i < affectedTracks.size(); ++i) { |
1123 RefPtr<Event> event = Event::create(EventTypeNames::cuechange); | 1123 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::cuechang
e); |
1124 event->setTarget(affectedTracks[i]); | 1124 event->setTarget(affectedTracks[i]); |
1125 | 1125 |
1126 m_asyncEventQueue->enqueueEvent(event.release()); | 1126 m_asyncEventQueue->enqueueEvent(event.release()); |
1127 | 1127 |
1128 // ... if the text track has a corresponding track element, to then fire
a | 1128 // ... if the text track has a corresponding track element, to then fire
a |
1129 // simple event named cuechange at the track element as well. | 1129 // simple event named cuechange at the track element as well. |
1130 if (affectedTracks[i]->trackType() == TextTrack::TrackElement) { | 1130 if (affectedTracks[i]->trackType() == TextTrack::TrackElement) { |
1131 RefPtr<Event> event = Event::create(EventTypeNames::cuechange); | 1131 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::cuec
hange); |
1132 HTMLTrackElement* trackElement = static_cast<LoadableTextTrack*>(aff
ectedTracks[i])->trackElement(); | 1132 HTMLTrackElement* trackElement = static_cast<LoadableTextTrack*>(aff
ectedTracks[i])->trackElement(); |
1133 ASSERT(trackElement); | 1133 ASSERT(trackElement); |
1134 event->setTarget(trackElement); | 1134 event->setTarget(trackElement); |
1135 | 1135 |
1136 m_asyncEventQueue->enqueueEvent(event.release()); | 1136 m_asyncEventQueue->enqueueEvent(event.release()); |
1137 } | 1137 } |
1138 } | 1138 } |
1139 | 1139 |
1140 // 16 - Set the text track cue active flag of all the cues in the current | 1140 // 16 - Set the text track cue active flag of all the cues in the current |
1141 // cues, and unset the text track cue active flag of all the cues in the | 1141 // cues, and unset the text track cue active flag of all the cues in the |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3641 { | 3641 { |
3642 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 3642 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
3643 } | 3643 } |
3644 | 3644 |
3645 bool HTMLMediaElement::isInteractiveContent() const | 3645 bool HTMLMediaElement::isInteractiveContent() const |
3646 { | 3646 { |
3647 return fastHasAttribute(controlsAttr); | 3647 return fastHasAttribute(controlsAttr); |
3648 } | 3648 } |
3649 | 3649 |
3650 } | 3650 } |
OLD | NEW |