Chromium Code Reviews| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 657 m_loadTimer.stop(); | 657 m_loadTimer.stop(); |
| 658 m_sentEndEvent = false; | 658 m_sentEndEvent = false; |
| 659 m_sentStalledEvent = false; | 659 m_sentStalledEvent = false; |
| 660 m_haveFiredLoadedData = false; | 660 m_haveFiredLoadedData = false; |
| 661 m_completelyLoaded = false; | 661 m_completelyLoaded = false; |
| 662 m_havePreparedToPlay = false; | 662 m_havePreparedToPlay = false; |
| 663 m_displayMode = Unknown; | 663 m_displayMode = Unknown; |
| 664 | 664 |
| 665 // 1 - Abort any already-running instance of the resource selection algorith m for this element. | 665 // 1 - Abort any already-running instance of the resource selection algorith m for this element. |
| 666 m_loadState = WaitingForSource; | 666 m_loadState = WaitingForSource; |
| 667 m_currentSourceNode = 0; | 667 m_currentSourceNode = nullptr; |
| 668 | 668 |
| 669 // 2 - If there are any tasks from the media element's media element event t ask source in | 669 // 2 - If there are any tasks from the media element's media element event t ask source in |
| 670 // one of the task queues, then remove those tasks. | 670 // one of the task queues, then remove those tasks. |
| 671 cancelPendingEventsAndCallbacks(); | 671 cancelPendingEventsAndCallbacks(); |
| 672 | 672 |
| 673 // 3 - If the media element's networkState is set to NETWORK_LOADING or NETW ORK_IDLE, queue | 673 // 3 - If the media element's networkState is set to NETWORK_LOADING or NETW ORK_IDLE, queue |
| 674 // a task to fire a simple event named abort at the media element. | 674 // a task to fire a simple event named abort at the media element. |
| 675 if (m_networkState == NETWORK_LOADING || m_networkState == NETWORK_IDLE) | 675 if (m_networkState == NETWORK_LOADING || m_networkState == NETWORK_IDLE) |
| 676 scheduleEvent(eventNames().abortEvent); | 676 scheduleEvent(eventNames().abortEvent); |
| 677 | 677 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 774 for (node = firstChild(); node; node = node->nextSibling()) { | 774 for (node = firstChild(); node; node = node->nextSibling()) { |
| 775 if (node->hasTagName(sourceTag)) | 775 if (node->hasTagName(sourceTag)) |
| 776 break; | 776 break; |
| 777 } | 777 } |
| 778 | 778 |
| 779 // Otherwise, if the media element does not have a src attribute but has a source | 779 // Otherwise, if the media element does not have a src attribute but has a source |
| 780 // element child, then let mode be children and let candidate be the fir st such | 780 // element child, then let mode be children and let candidate be the fir st such |
| 781 // source element child in tree order. | 781 // source element child in tree order. |
| 782 if (node) { | 782 if (node) { |
| 783 mode = children; | 783 mode = children; |
| 784 m_nextChildNodeToConsider = node; | 784 m_nextChildNodeToConsider = adoptRawResult(node); |
| 785 m_currentSourceNode = 0; | 785 m_currentSourceNode = nullptr; |
| 786 } else { | 786 } else { |
| 787 // Otherwise the media element has neither a src attribute nor a sou rce element | 787 // Otherwise the media element has neither a src attribute nor a sou rce element |
| 788 // child: set the networkState to NETWORK_EMPTY, and abort these ste ps; the | 788 // child: set the networkState to NETWORK_EMPTY, and abort these ste ps; the |
| 789 // synchronous section ends. | 789 // synchronous section ends. |
| 790 m_loadState = WaitingForSource; | 790 m_loadState = WaitingForSource; |
| 791 setShouldDelayLoadEvent(false); | 791 setShouldDelayLoadEvent(false); |
| 792 m_networkState = NETWORK_EMPTY; | 792 m_networkState = NETWORK_EMPTY; |
| 793 | 793 |
| 794 LOG(Media, "HTMLMediaElement::selectMediaResource, nothing to load") ; | 794 LOG(Media, "HTMLMediaElement::selectMediaResource, nothing to load") ; |
| 795 return; | 795 return; |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1374 if (renderer()) | 1374 if (renderer()) |
| 1375 renderer()->updateFromElement(); | 1375 renderer()->updateFromElement(); |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 void HTMLMediaElement::noneSupported() | 1378 void HTMLMediaElement::noneSupported() |
| 1379 { | 1379 { |
| 1380 LOG(Media, "HTMLMediaElement::noneSupported"); | 1380 LOG(Media, "HTMLMediaElement::noneSupported"); |
| 1381 | 1381 |
| 1382 stopPeriodicTimers(); | 1382 stopPeriodicTimers(); |
| 1383 m_loadState = WaitingForSource; | 1383 m_loadState = WaitingForSource; |
| 1384 m_currentSourceNode = 0; | 1384 m_currentSourceNode = nullptr; |
| 1385 | 1385 |
| 1386 // 4.8.10.5 | 1386 // 4.8.10.5 |
| 1387 // 6 - Reaching this step indicates that the media resource failed to load o r that the given | 1387 // 6 - Reaching this step indicates that the media resource failed to load o r that the given |
| 1388 // URL could not be resolved. In one atomic operation, run the following ste ps: | 1388 // URL could not be resolved. In one atomic operation, run the following ste ps: |
| 1389 | 1389 |
| 1390 // 6.1 - Set the error attribute to a new MediaError object whose code attri bute is set to | 1390 // 6.1 - Set the error attribute to a new MediaError object whose code attri bute is set to |
| 1391 // MEDIA_ERR_SRC_NOT_SUPPORTED. | 1391 // MEDIA_ERR_SRC_NOT_SUPPORTED. |
| 1392 m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED); | 1392 m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED); |
| 1393 | 1393 |
| 1394 // 6.2 - Forget the media element's media-resource-specific text tracks. | 1394 // 6.2 - Forget the media element's media-resource-specific text tracks. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1432 | 1432 |
| 1433 // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value a nd queue a | 1433 // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value a nd queue a |
| 1434 // task to fire a simple event called emptied at the element. | 1434 // task to fire a simple event called emptied at the element. |
| 1435 m_networkState = NETWORK_EMPTY; | 1435 m_networkState = NETWORK_EMPTY; |
| 1436 scheduleEvent(eventNames().emptiedEvent); | 1436 scheduleEvent(eventNames().emptiedEvent); |
| 1437 | 1437 |
| 1438 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event. | 1438 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event. |
| 1439 setShouldDelayLoadEvent(false); | 1439 setShouldDelayLoadEvent(false); |
| 1440 | 1440 |
| 1441 // 6 - Abort the overall resource selection algorithm. | 1441 // 6 - Abort the overall resource selection algorithm. |
| 1442 m_currentSourceNode = 0; | 1442 m_currentSourceNode = nullptr; |
| 1443 } | 1443 } |
| 1444 | 1444 |
| 1445 void HTMLMediaElement::cancelPendingEventsAndCallbacks() | 1445 void HTMLMediaElement::cancelPendingEventsAndCallbacks() |
| 1446 { | 1446 { |
| 1447 LOG(Media, "HTMLMediaElement::cancelPendingEventsAndCallbacks"); | 1447 LOG(Media, "HTMLMediaElement::cancelPendingEventsAndCallbacks"); |
| 1448 m_asyncEventQueue->cancelAllEvents(); | 1448 m_asyncEventQueue->cancelAllEvents(); |
| 1449 | 1449 |
| 1450 for (Node* node = firstChild(); node; node = node->nextSibling()) { | 1450 for (Node* node = firstChild(); node; node = node->nextSibling()) { |
| 1451 if (node->hasTagName(sourceTag)) | 1451 if (node->hasTagName(sourceTag)) |
| 1452 static_cast<HTMLSourceElement*>(node)->cancelPendingErrorEvent(); | 1452 static_cast<HTMLSourceElement*>(node)->cancelPendingErrorEvent(); |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3020 configureTextTrackGroup(otherTracks); | 3020 configureTextTrackGroup(otherTracks); |
| 3021 | 3021 |
| 3022 if (hasMediaControls()) | 3022 if (hasMediaControls()) |
| 3023 mediaControls()->closedCaptionTracksChanged(); | 3023 mediaControls()->closedCaptionTracksChanged(); |
| 3024 } | 3024 } |
| 3025 | 3025 |
| 3026 bool HTMLMediaElement::havePotentialSourceChild() | 3026 bool HTMLMediaElement::havePotentialSourceChild() |
| 3027 { | 3027 { |
| 3028 // Stash the current <source> node and next nodes so we can restore them aft er checking | 3028 // Stash the current <source> node and next nodes so we can restore them aft er checking |
| 3029 // to see there is another potential. | 3029 // to see there is another potential. |
| 3030 RefPtr<HTMLSourceElement> currentSourceNode = m_currentSourceNode; | 3030 Handle<HTMLSourceElement> currentSourceNode = m_currentSourceNode; |
| 3031 RefPtr<Node> nextNode = m_nextChildNodeToConsider; | 3031 Handle<Node> nextNode = m_nextChildNodeToConsider; |
| 3032 | 3032 |
| 3033 KURL nextURL = selectNextSourceChild(0, 0, DoNothing); | 3033 KURL nextURL = selectNextSourceChild(0, 0, DoNothing); |
| 3034 | 3034 |
| 3035 m_currentSourceNode = currentSourceNode; | 3035 m_currentSourceNode = currentSourceNode; |
| 3036 m_nextChildNodeToConsider = nextNode; | 3036 m_nextChildNodeToConsider = nextNode; |
| 3037 | 3037 |
| 3038 return nextURL.isValid(); | 3038 return nextURL.isValid(); |
| 3039 } | 3039 } |
| 3040 | 3040 |
| 3041 KURL HTMLMediaElement::selectNextSourceChild(ContentType* contentType, String* k eySystem, InvalidURLAction actionIfInvalid) | 3041 KURL HTMLMediaElement::selectNextSourceChild(ContentType* contentType, String* k eySystem, InvalidURLAction actionIfInvalid) |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 3060 HTMLSourceElement* source = 0; | 3060 HTMLSourceElement* source = 0; |
| 3061 String type; | 3061 String type; |
| 3062 String system; | 3062 String system; |
| 3063 bool lookingForStartNode = m_nextChildNodeToConsider; | 3063 bool lookingForStartNode = m_nextChildNodeToConsider; |
| 3064 bool canUseSourceElement = false; | 3064 bool canUseSourceElement = false; |
| 3065 bool okToLoadSourceURL; | 3065 bool okToLoadSourceURL; |
| 3066 | 3066 |
| 3067 NodeVector potentialSourceNodes; | 3067 NodeVector potentialSourceNodes; |
| 3068 getChildNodes(this, potentialSourceNodes); | 3068 getChildNodes(this, potentialSourceNodes); |
| 3069 | 3069 |
| 3070 for (unsigned i = 0; !canUseSourceElement && i < potentialSourceNodes.size() ; ++i) { | 3070 for (unsigned i = 0; !canUseSourceElement && i < potentialSourceNodes.size() ; ++i) { |
|
Mads Ager (chromium)
2013/07/25 13:35:12
HandleScope?
haraken
2013/07/25 13:44:49
Done.
| |
| 3071 node = potentialSourceNodes[i].get(); | 3071 node = potentialSourceNodes[i].get(); |
| 3072 if (lookingForStartNode && m_nextChildNodeToConsider != node) | 3072 if (lookingForStartNode && Handle<Node>(m_nextChildNodeToConsider).raw() != node) |
| 3073 continue; | 3073 continue; |
| 3074 lookingForStartNode = false; | 3074 lookingForStartNode = false; |
| 3075 | 3075 |
| 3076 if (!node->hasTagName(sourceTag)) | 3076 if (!node->hasTagName(sourceTag)) |
| 3077 continue; | 3077 continue; |
| 3078 if (node->parentNode() != this) | 3078 if (node->parentNode() != this) |
| 3079 continue; | 3079 continue; |
| 3080 | 3080 |
| 3081 source = static_cast<HTMLSourceElement*>(node); | 3081 source = static_cast<HTMLSourceElement*>(node); |
| 3082 | 3082 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3131 check_again: | 3131 check_again: |
| 3132 if (!canUseSourceElement && actionIfInvalid == Complain && source) | 3132 if (!canUseSourceElement && actionIfInvalid == Complain && source) |
| 3133 source->scheduleErrorEvent(); | 3133 source->scheduleErrorEvent(); |
| 3134 } | 3134 } |
| 3135 | 3135 |
| 3136 if (canUseSourceElement) { | 3136 if (canUseSourceElement) { |
| 3137 if (contentType) | 3137 if (contentType) |
| 3138 *contentType = ContentType(type); | 3138 *contentType = ContentType(type); |
| 3139 if (keySystem) | 3139 if (keySystem) |
| 3140 *keySystem = system; | 3140 *keySystem = system; |
| 3141 m_currentSourceNode = source; | 3141 m_currentSourceNode = adoptRawResult(source); |
| 3142 m_nextChildNodeToConsider = source->nextSibling(); | 3142 m_nextChildNodeToConsider = adoptRawResult(source->nextSibling()); |
| 3143 } else { | 3143 } else { |
| 3144 m_currentSourceNode = 0; | 3144 m_currentSourceNode = nullptr; |
| 3145 m_nextChildNodeToConsider = 0; | 3145 m_nextChildNodeToConsider = nullptr; |
| 3146 } | 3146 } |
| 3147 | 3147 |
| 3148 #if !LOG_DISABLED | 3148 #if !LOG_DISABLED |
| 3149 if (shouldLog) | 3149 if (shouldLog) |
| 3150 LOG(Media, "HTMLMediaElement::selectNextSourceChild -> %p, %s", m_curren tSourceNode.get(), canUseSourceElement ? urlForLoggingMedia(mediaURL).utf8().dat a() : ""); | 3150 LOG(Media, "HTMLMediaElement::selectNextSourceChild -> %p, %s", Handle<H TMLSourceElement>(m_currentSourceNode).raw(), canUseSourceElement ? urlForLoggin gMedia(mediaURL).utf8().data() : ""); |
| 3151 #endif | 3151 #endif |
| 3152 return canUseSourceElement ? mediaURL : KURL(); | 3152 return canUseSourceElement ? mediaURL : KURL(); |
| 3153 } | 3153 } |
| 3154 | 3154 |
| 3155 void HTMLMediaElement::sourceWasAdded(HTMLSourceElement* source) | 3155 void HTMLMediaElement::sourceWasAdded(HTMLSourceElement* source) |
| 3156 { | 3156 { |
| 3157 LOG(Media, "HTMLMediaElement::sourceWasAdded(%p)", source); | 3157 LOG(Media, "HTMLMediaElement::sourceWasAdded(%p)", source); |
| 3158 | 3158 |
| 3159 #if !LOG_DISABLED | 3159 #if !LOG_DISABLED |
| 3160 if (source->hasTagName(sourceTag)) { | 3160 if (source->hasTagName(sourceTag)) { |
| 3161 KURL url = source->getNonEmptyURLAttribute(srcAttr); | 3161 KURL url = source->getNonEmptyURLAttribute(srcAttr); |
| 3162 LOG(Media, "HTMLMediaElement::sourceWasAdded - 'src' is %s", urlForLoggi ngMedia(url).utf8().data()); | 3162 LOG(Media, "HTMLMediaElement::sourceWasAdded - 'src' is %s", urlForLoggi ngMedia(url).utf8().data()); |
| 3163 } | 3163 } |
| 3164 #endif | 3164 #endif |
| 3165 | 3165 |
| 3166 // We should only consider a <source> element when there is not src attribut e at all. | 3166 // We should only consider a <source> element when there is not src attribut e at all. |
| 3167 if (fastHasAttribute(srcAttr)) | 3167 if (fastHasAttribute(srcAttr)) |
| 3168 return; | 3168 return; |
| 3169 | 3169 |
| 3170 // 4.8.8 - If a source element is inserted as a child of a media element tha t has no src | 3170 // 4.8.8 - If a source element is inserted as a child of a media element tha t has no src |
| 3171 // attribute and whose networkState has the value NETWORK_EMPTY, the user ag ent must invoke | 3171 // attribute and whose networkState has the value NETWORK_EMPTY, the user ag ent must invoke |
| 3172 // the media element's resource selection algorithm. | 3172 // the media element's resource selection algorithm. |
| 3173 if (networkState() == HTMLMediaElement::NETWORK_EMPTY) { | 3173 if (networkState() == HTMLMediaElement::NETWORK_EMPTY) { |
| 3174 scheduleDelayedAction(LoadMediaResource); | 3174 scheduleDelayedAction(LoadMediaResource); |
| 3175 m_nextChildNodeToConsider = source; | 3175 m_nextChildNodeToConsider = adoptRawResult(source); |
| 3176 return; | 3176 return; |
| 3177 } | 3177 } |
| 3178 | 3178 |
| 3179 if (m_currentSourceNode && source == m_currentSourceNode->nextSibling()) { | 3179 if (m_currentSourceNode && source == m_currentSourceNode->nextSibling()) { |
| 3180 LOG(Media, "HTMLMediaElement::sourceWasAdded - <source> inserted immedia tely after current source"); | 3180 LOG(Media, "HTMLMediaElement::sourceWasAdded - <source> inserted immedia tely after current source"); |
| 3181 m_nextChildNodeToConsider = source; | 3181 m_nextChildNodeToConsider = adoptRawResult(source); |
| 3182 return; | 3182 return; |
| 3183 } | 3183 } |
| 3184 | 3184 |
| 3185 if (m_nextChildNodeToConsider) | 3185 if (m_nextChildNodeToConsider) |
| 3186 return; | 3186 return; |
| 3187 | 3187 |
| 3188 // 4.8.9.5, resource selection algorithm, source elements section: | 3188 // 4.8.9.5, resource selection algorithm, source elements section: |
| 3189 // 21. Wait until the node after pointer is a node other than the end of the list. (This step might wait forever.) | 3189 // 21. Wait until the node after pointer is a node other than the end of the list. (This step might wait forever.) |
| 3190 // 22. Asynchronously await a stable state... | 3190 // 22. Asynchronously await a stable state... |
| 3191 // 23. Set the element's delaying-the-load-event flag back to true (this del ays the load event again, in case | 3191 // 23. Set the element's delaying-the-load-event flag back to true (this del ays the load event again, in case |
| 3192 // it hasn't been fired yet). | 3192 // it hasn't been fired yet). |
| 3193 setShouldDelayLoadEvent(true); | 3193 setShouldDelayLoadEvent(true); |
| 3194 | 3194 |
| 3195 // 24. Set the networkState back to NETWORK_LOADING. | 3195 // 24. Set the networkState back to NETWORK_LOADING. |
| 3196 m_networkState = NETWORK_LOADING; | 3196 m_networkState = NETWORK_LOADING; |
| 3197 | 3197 |
| 3198 // 25. Jump back to the find next candidate step above. | 3198 // 25. Jump back to the find next candidate step above. |
| 3199 m_nextChildNodeToConsider = source; | 3199 m_nextChildNodeToConsider = adoptRawResult(source); |
| 3200 scheduleNextSourceChild(); | 3200 scheduleNextSourceChild(); |
| 3201 } | 3201 } |
| 3202 | 3202 |
| 3203 void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement* source) | 3203 void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement* source) |
| 3204 { | 3204 { |
| 3205 LOG(Media, "HTMLMediaElement::sourceWasRemoved(%p)", source); | 3205 LOG(Media, "HTMLMediaElement::sourceWasRemoved(%p)", source); |
| 3206 | 3206 |
| 3207 #if !LOG_DISABLED | 3207 #if !LOG_DISABLED |
| 3208 if (source->hasTagName(sourceTag)) { | 3208 if (source->hasTagName(sourceTag)) { |
| 3209 KURL url = source->getNonEmptyURLAttribute(srcAttr); | 3209 KURL url = source->getNonEmptyURLAttribute(srcAttr); |
| 3210 LOG(Media, "HTMLMediaElement::sourceWasRemoved - 'src' is %s", urlForLog gingMedia(url).utf8().data()); | 3210 LOG(Media, "HTMLMediaElement::sourceWasRemoved - 'src' is %s", urlForLog gingMedia(url).utf8().data()); |
| 3211 } | 3211 } |
| 3212 #endif | 3212 #endif |
| 3213 | 3213 |
| 3214 if (source != m_currentSourceNode && source != m_nextChildNodeToConsider) | 3214 if (source != Handle<HTMLSourceElement>(m_currentSourceNode).raw() && source != Handle<Node>(m_nextChildNodeToConsider).raw()) |
|
Mads Ager (chromium)
2013/07/25 13:35:12
Do you need the handle wrapping followed by raw()
haraken
2013/07/25 13:44:49
I reverted the members to RefPtrs (and remove thes
| |
| 3215 return; | 3215 return; |
| 3216 | 3216 |
| 3217 if (source == m_nextChildNodeToConsider) { | 3217 if (source == Handle<Node>(m_nextChildNodeToConsider).raw()) { |
| 3218 if (m_currentSourceNode) | 3218 if (m_currentSourceNode) |
| 3219 m_nextChildNodeToConsider = m_currentSourceNode->nextSibling(); | 3219 m_nextChildNodeToConsider = adoptRawResult(m_currentSourceNode->next Sibling()); |
| 3220 LOG(Media, "HTMLMediaElement::sourceRemoved - m_nextChildNodeToConsider set to %p", m_nextChildNodeToConsider.get()); | 3220 LOG(Media, "HTMLMediaElement::sourceRemoved - m_nextChildNodeToConsider set to %p", Handle<Node>(m_nextChildNodeToConsider).raw()); |
| 3221 } else if (source == m_currentSourceNode) { | 3221 } else if (source == Handle<HTMLSourceElement>(m_currentSourceNode).raw()) { |
| 3222 // Clear the current source node pointer, but don't change the movie as the spec says: | 3222 // Clear the current source node pointer, but don't change the movie as the spec says: |
| 3223 // 4.8.8 - Dynamically modifying a source element and its attribute when the element is already | 3223 // 4.8.8 - Dynamically modifying a source element and its attribute when the element is already |
| 3224 // inserted in a video or audio element will have no effect. | 3224 // inserted in a video or audio element will have no effect. |
| 3225 m_currentSourceNode = 0; | 3225 m_currentSourceNode = nullptr; |
| 3226 LOG(Media, "HTMLMediaElement::sourceRemoved - m_currentSourceNode set to 0"); | 3226 LOG(Media, "HTMLMediaElement::sourceRemoved - m_currentSourceNode set to 0"); |
| 3227 } | 3227 } |
| 3228 } | 3228 } |
| 3229 | 3229 |
| 3230 void HTMLMediaElement::mediaPlayerTimeChanged(MediaPlayer*) | 3230 void HTMLMediaElement::mediaPlayerTimeChanged(MediaPlayer*) |
| 3231 { | 3231 { |
| 3232 LOG(Media, "HTMLMediaElement::mediaPlayerTimeChanged"); | 3232 LOG(Media, "HTMLMediaElement::mediaPlayerTimeChanged"); |
| 3233 | 3233 |
| 3234 if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) | 3234 if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) |
| 3235 updateActiveTextTrackCues(currentTime()); | 3235 updateActiveTextTrackCues(currentTime()); |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3672 m_networkState = NETWORK_EMPTY; | 3672 m_networkState = NETWORK_EMPTY; |
| 3673 scheduleEvent(eventNames().emptiedEvent); | 3673 scheduleEvent(eventNames().emptiedEvent); |
| 3674 } | 3674 } |
| 3675 else | 3675 else |
| 3676 m_networkState = NETWORK_IDLE; | 3676 m_networkState = NETWORK_IDLE; |
| 3677 | 3677 |
| 3678 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event. | 3678 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event. |
| 3679 setShouldDelayLoadEvent(false); | 3679 setShouldDelayLoadEvent(false); |
| 3680 | 3680 |
| 3681 // 6 - Abort the overall resource selection algorithm. | 3681 // 6 - Abort the overall resource selection algorithm. |
| 3682 m_currentSourceNode = 0; | 3682 m_currentSourceNode = nullptr; |
| 3683 | 3683 |
| 3684 // Reset m_readyState since m_player is gone. | 3684 // Reset m_readyState since m_player is gone. |
| 3685 m_readyState = HAVE_NOTHING; | 3685 m_readyState = HAVE_NOTHING; |
| 3686 updateMediaController(); | 3686 updateMediaController(); |
| 3687 if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) | 3687 if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) |
| 3688 updateActiveTextTrackCues(0); | 3688 updateActiveTextTrackCues(0); |
| 3689 } | 3689 } |
| 3690 | 3690 |
| 3691 void HTMLMediaElement::clearMediaPlayer(int flags) | 3691 void HTMLMediaElement::clearMediaPlayer(int flags) |
| 3692 { | 3692 { |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4451 info.addMember(m_currentlyActiveCues, "currentlyActiveCues"); | 4451 info.addMember(m_currentlyActiveCues, "currentlyActiveCues"); |
| 4452 info.addMember(m_mediaGroup, "mediaGroup"); | 4452 info.addMember(m_mediaGroup, "mediaGroup"); |
| 4453 info.addMember(m_mediaController, "mediaController"); | 4453 info.addMember(m_mediaController, "mediaController"); |
| 4454 | 4454 |
| 4455 #if ENABLE(WEB_AUDIO) | 4455 #if ENABLE(WEB_AUDIO) |
| 4456 info.addMember(m_audioSourceNode, "audioSourceNode"); | 4456 info.addMember(m_audioSourceNode, "audioSourceNode"); |
| 4457 #endif | 4457 #endif |
| 4458 | 4458 |
| 4459 } | 4459 } |
| 4460 | 4460 |
| 4461 void HTMLMediaElement::acceptHeapVisitor(Visitor* visitor) const | |
| 4462 { | |
| 4463 visitor->visit(m_currentSourceNode); | |
| 4464 visitor->visit(m_nextChildNodeToConsider); | |
| 4465 HTMLElement::acceptHeapVisitor(visitor); | |
| 4461 } | 4466 } |
| 4467 | |
| 4468 } | |
| OLD | NEW |