Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 , m_sentStalledEvent(false) 295 , m_sentStalledEvent(false)
296 , m_sentEndEvent(false) 296 , m_sentEndEvent(false)
297 , m_pausedInternal(false) 297 , m_pausedInternal(false)
298 , m_closedCaptionsVisible(false) 298 , m_closedCaptionsVisible(false)
299 , m_completelyLoaded(false) 299 , m_completelyLoaded(false)
300 , m_havePreparedToPlay(false) 300 , m_havePreparedToPlay(false)
301 , m_tracksAreReady(true) 301 , m_tracksAreReady(true)
302 , m_haveVisibleTextTrack(false) 302 , m_haveVisibleTextTrack(false)
303 , m_processingPreferenceChange(false) 303 , m_processingPreferenceChange(false)
304 , m_lastTextTrackUpdateTime(-1) 304 , m_lastTextTrackUpdateTime(-1)
305 , m_textTracks(0) 305 , m_textTracks(nullptr)
306 , m_ignoreTrackDisplayUpdate(0) 306 , m_ignoreTrackDisplayUpdate(0)
307 #if ENABLE(WEB_AUDIO) 307 #if ENABLE(WEB_AUDIO)
308 , m_audioSourceNode(0) 308 , m_audioSourceNode(0)
309 #endif 309 #endif
310 , m_emeMode(EmeModeNotSelected) 310 , m_emeMode(EmeModeNotSelected)
311 { 311 {
312 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); 312 ASSERT(RuntimeEnabledFeatures::mediaEnabled());
313 313
314 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement"); 314 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement");
315 ScriptWrappable::init(this); 315 ScriptWrappable::init(this);
(...skipping 21 matching lines...) Expand all
337 setShouldDelayLoadEvent(false); 337 setShouldDelayLoadEvent(false);
338 if (m_textTracks) 338 if (m_textTracks)
339 m_textTracks->clearOwner(); 339 m_textTracks->clearOwner();
340 if (m_textTracks) { 340 if (m_textTracks) {
341 for (unsigned i = 0; i < m_textTracks->length(); ++i) 341 for (unsigned i = 0; i < m_textTracks->length(); ++i)
342 m_textTracks->item(i)->clearClient(); 342 m_textTracks->item(i)->clearClient();
343 } 343 }
344 344
345 if (m_mediaController) { 345 if (m_mediaController) {
346 m_mediaController->removeMediaElement(this); 346 m_mediaController->removeMediaElement(this);
347 m_mediaController = 0; 347 m_mediaController = nullptr;
348 } 348 }
349 349
350 closeMediaSource(); 350 closeMediaSource();
351 351
352 setMediaKeysInternal(0); 352 setMediaKeysInternal(0);
353 353
354 removeElementFromDocumentMap(this, &document()); 354 removeElementFromDocumentMap(this, &document());
355 355
356 // Destroying the player may cause a resource load to be canceled, 356 // Destroying the player may cause a resource load to be canceled,
357 // which could result in userCancelledLoad() being called back. 357 // which could result in userCancelledLoad() being called back.
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 m_loadTimer.stop(); 639 m_loadTimer.stop();
640 m_sentEndEvent = false; 640 m_sentEndEvent = false;
641 m_sentStalledEvent = false; 641 m_sentStalledEvent = false;
642 m_haveFiredLoadedData = false; 642 m_haveFiredLoadedData = false;
643 m_completelyLoaded = false; 643 m_completelyLoaded = false;
644 m_havePreparedToPlay = false; 644 m_havePreparedToPlay = false;
645 m_displayMode = Unknown; 645 m_displayMode = Unknown;
646 646
647 // 1 - Abort any already-running instance of the resource selection algorith m for this element. 647 // 1 - Abort any already-running instance of the resource selection algorith m for this element.
648 m_loadState = WaitingForSource; 648 m_loadState = WaitingForSource;
649 m_currentSourceNode = 0; 649 m_currentSourceNode = nullptr;
650 650
651 // 2 - If there are any tasks from the media element's media element event t ask source in 651 // 2 - If there are any tasks from the media element's media element event t ask source in
652 // one of the task queues, then remove those tasks. 652 // one of the task queues, then remove those tasks.
653 cancelPendingEventsAndCallbacks(); 653 cancelPendingEventsAndCallbacks();
654 654
655 // 3 - If the media element's networkState is set to NETWORK_LOADING or NETW ORK_IDLE, queue 655 // 3 - If the media element's networkState is set to NETWORK_LOADING or NETW ORK_IDLE, queue
656 // a task to fire a simple event named abort at the media element. 656 // a task to fire a simple event named abort at the media element.
657 if (m_networkState == NETWORK_LOADING || m_networkState == NETWORK_IDLE) 657 if (m_networkState == NETWORK_LOADING || m_networkState == NETWORK_IDLE)
658 scheduleEvent(EventTypeNames::abort); 658 scheduleEvent(EventTypeNames::abort);
659 659
(...skipping 13 matching lines...) Expand all
673 scheduleEvent(EventTypeNames::emptied); 673 scheduleEvent(EventTypeNames::emptied);
674 updateMediaController(); 674 updateMediaController();
675 if (RuntimeEnabledFeatures::videoTrackEnabled()) 675 if (RuntimeEnabledFeatures::videoTrackEnabled())
676 updateActiveTextTrackCues(0); 676 updateActiveTextTrackCues(0);
677 } 677 }
678 678
679 // 5 - Set the playbackRate attribute to the value of the defaultPlaybackRat e attribute. 679 // 5 - Set the playbackRate attribute to the value of the defaultPlaybackRat e attribute.
680 setPlaybackRate(defaultPlaybackRate()); 680 setPlaybackRate(defaultPlaybackRate());
681 681
682 // 6 - Set the error attribute to null and the autoplaying flag to true. 682 // 6 - Set the error attribute to null and the autoplaying flag to true.
683 m_error = 0; 683 m_error = nullptr;
684 m_autoplaying = true; 684 m_autoplaying = true;
685 685
686 // 7 - Invoke the media element's resource selection algorithm. 686 // 7 - Invoke the media element's resource selection algorithm.
687 687
688 // 8 - Note: Playback of any previously playing media resource for this elem ent stops. 688 // 8 - Note: Playback of any previously playing media resource for this elem ent stops.
689 689
690 // The resource selection algorithm 690 // The resource selection algorithm
691 // 1 - Set the networkState to NETWORK_NO_SOURCE 691 // 1 - Set the networkState to NETWORK_NO_SOURCE
692 m_networkState = NETWORK_NO_SOURCE; 692 m_networkState = NETWORK_NO_SOURCE;
693 693
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 if (element->hasTagName(sourceTag)) 742 if (element->hasTagName(sourceTag))
743 break; 743 break;
744 } 744 }
745 745
746 // Otherwise, if the media element does not have a src attribute but has a source 746 // Otherwise, if the media element does not have a src attribute but has a source
747 // element child, then let mode be children and let candidate be the fir st such 747 // element child, then let mode be children and let candidate be the fir st such
748 // source element child in tree order. 748 // source element child in tree order.
749 if (element) { 749 if (element) {
750 mode = children; 750 mode = children;
751 m_nextChildNodeToConsider = element; 751 m_nextChildNodeToConsider = element;
752 m_currentSourceNode = 0; 752 m_currentSourceNode = nullptr;
753 } else { 753 } else {
754 // Otherwise the media element has neither a src attribute nor a sou rce element 754 // Otherwise the media element has neither a src attribute nor a sou rce element
755 // child: set the networkState to NETWORK_EMPTY, and abort these ste ps; the 755 // child: set the networkState to NETWORK_EMPTY, and abort these ste ps; the
756 // synchronous section ends. 756 // synchronous section ends.
757 m_loadState = WaitingForSource; 757 m_loadState = WaitingForSource;
758 setShouldDelayLoadEvent(false); 758 setShouldDelayLoadEvent(false);
759 m_networkState = NETWORK_EMPTY; 759 m_networkState = NETWORK_EMPTY;
760 760
761 WTF_LOG(Media, "HTMLMediaElement::selectMediaResource, nothing to lo ad"); 761 WTF_LOG(Media, "HTMLMediaElement::selectMediaResource, nothing to lo ad");
762 return; 762 return;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 removeBehaviorRestriction(RequireUserGestureForPlayRestriction); 863 removeBehaviorRestriction(RequireUserGestureForPlayRestriction);
864 } else { 864 } else {
865 m_mediaSource = HTMLMediaSource::lookup(url.string()); 865 m_mediaSource = HTMLMediaSource::lookup(url.string());
866 866
867 if (m_mediaSource) { 867 if (m_mediaSource) {
868 loadType = blink::WebMediaPlayer::LoadTypeMediaSource; 868 loadType = blink::WebMediaPlayer::LoadTypeMediaSource;
869 869
870 if (!m_mediaSource->attachToElement(this)) { 870 if (!m_mediaSource->attachToElement(this)) {
871 // Forget our reference to the MediaSource, so we leave it a lone 871 // Forget our reference to the MediaSource, so we leave it a lone
872 // while processing remainder of load failure. 872 // while processing remainder of load failure.
873 m_mediaSource = 0; 873 m_mediaSource = nullptr;
874 attemptLoad = false; 874 attemptLoad = false;
875 } 875 }
876 } 876 }
877 } 877 }
878 } 878 }
879 879
880 if (attemptLoad && canLoadURL(url, contentType, keySystem)) { 880 if (attemptLoad && canLoadURL(url, contentType, keySystem)) {
881 m_player->load(loadType, url); 881 m_player->load(loadType, url);
882 } else { 882 } else {
883 mediaLoadingFailed(MediaPlayer::FormatError); 883 mediaLoadingFailed(MediaPlayer::FormatError);
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 if (renderer()) 1346 if (renderer())
1347 renderer()->updateFromElement(); 1347 renderer()->updateFromElement();
1348 } 1348 }
1349 1349
1350 void HTMLMediaElement::noneSupported() 1350 void HTMLMediaElement::noneSupported()
1351 { 1351 {
1352 WTF_LOG(Media, "HTMLMediaElement::noneSupported"); 1352 WTF_LOG(Media, "HTMLMediaElement::noneSupported");
1353 1353
1354 stopPeriodicTimers(); 1354 stopPeriodicTimers();
1355 m_loadState = WaitingForSource; 1355 m_loadState = WaitingForSource;
1356 m_currentSourceNode = 0; 1356 m_currentSourceNode = nullptr;
1357 1357
1358 // 4.8.10.5 1358 // 4.8.10.5
1359 // 6 - Reaching this step indicates that the media resource failed to load o r that the given 1359 // 6 - Reaching this step indicates that the media resource failed to load o r that the given
1360 // URL could not be resolved. In one atomic operation, run the following ste ps: 1360 // URL could not be resolved. In one atomic operation, run the following ste ps:
1361 1361
1362 // 6.1 - Set the error attribute to a new MediaError object whose code attri bute is set to 1362 // 6.1 - Set the error attribute to a new MediaError object whose code attri bute is set to
1363 // MEDIA_ERR_SRC_NOT_SUPPORTED. 1363 // MEDIA_ERR_SRC_NOT_SUPPORTED.
1364 m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED); 1364 m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
1365 1365
1366 // 6.2 - Forget the media element's media-resource-specific text tracks. 1366 // 6.2 - Forget the media element's media-resource-specific text tracks.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 1404
1405 // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value a nd queue a 1405 // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value a nd queue a
1406 // task to fire a simple event called emptied at the element. 1406 // task to fire a simple event called emptied at the element.
1407 m_networkState = NETWORK_EMPTY; 1407 m_networkState = NETWORK_EMPTY;
1408 scheduleEvent(EventTypeNames::emptied); 1408 scheduleEvent(EventTypeNames::emptied);
1409 1409
1410 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event. 1410 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event.
1411 setShouldDelayLoadEvent(false); 1411 setShouldDelayLoadEvent(false);
1412 1412
1413 // 6 - Abort the overall resource selection algorithm. 1413 // 6 - Abort the overall resource selection algorithm.
1414 m_currentSourceNode = 0; 1414 m_currentSourceNode = nullptr;
1415 } 1415 }
1416 1416
1417 void HTMLMediaElement::cancelPendingEventsAndCallbacks() 1417 void HTMLMediaElement::cancelPendingEventsAndCallbacks()
1418 { 1418 {
1419 WTF_LOG(Media, "HTMLMediaElement::cancelPendingEventsAndCallbacks"); 1419 WTF_LOG(Media, "HTMLMediaElement::cancelPendingEventsAndCallbacks");
1420 m_asyncEventQueue->cancelAllEvents(); 1420 m_asyncEventQueue->cancelAllEvents();
1421 1421
1422 for (Element* child = ElementTraversal::firstWithin(*this); child; child = E lementTraversal::nextSibling(*child)) { 1422 for (Element* child = ElementTraversal::firstWithin(*this); child; child = E lementTraversal::nextSibling(*child)) {
1423 if (child->hasTagName(sourceTag)) 1423 if (child->hasTagName(sourceTag))
1424 toHTMLSourceElement(child)->cancelPendingErrorEvent(); 1424 toHTMLSourceElement(child)->cancelPendingErrorEvent();
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2183 2183
2184 updatePlayState(); 2184 updatePlayState();
2185 } 2185 }
2186 2186
2187 void HTMLMediaElement::closeMediaSource() 2187 void HTMLMediaElement::closeMediaSource()
2188 { 2188 {
2189 if (!m_mediaSource) 2189 if (!m_mediaSource)
2190 return; 2190 return;
2191 2191
2192 m_mediaSource->close(); 2192 m_mediaSource->close();
2193 m_mediaSource = 0; 2193 m_mediaSource = nullptr;
2194 } 2194 }
2195 2195
2196 void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, PassRef Ptr<Uint8Array> initData, ExceptionState& exceptionState) 2196 void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, PassRef Ptr<Uint8Array> initData, ExceptionState& exceptionState)
2197 { 2197 {
2198 WTF_LOG(Media, "HTMLMediaElement::webkitGenerateKeyRequest"); 2198 WTF_LOG(Media, "HTMLMediaElement::webkitGenerateKeyRequest");
2199 2199
2200 if (!setEmeMode(EmeModePrefixed, exceptionState)) 2200 if (!setEmeMode(EmeModePrefixed, exceptionState))
2201 return; 2201 return;
2202 2202
2203 if (keySystem.isEmpty()) { 2203 if (keySystem.isEmpty()) {
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2545 PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const AtomicString& kind, c onst AtomicString& label, const AtomicString& language, ExceptionState& exceptio nState) 2545 PassRefPtr<TextTrack> HTMLMediaElement::addTextTrack(const AtomicString& kind, c onst AtomicString& label, const AtomicString& language, ExceptionState& exceptio nState)
2546 { 2546 {
2547 ASSERT(RuntimeEnabledFeatures::videoTrackEnabled()); 2547 ASSERT(RuntimeEnabledFeatures::videoTrackEnabled());
2548 2548
2549 // 4.8.10.12.4 Text track API 2549 // 4.8.10.12.4 Text track API
2550 // The addTextTrack(kind, label, language) method of media elements, when in voked, must run the following steps: 2550 // The addTextTrack(kind, label, language) method of media elements, when in voked, must run the following steps:
2551 2551
2552 // 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps 2552 // 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps
2553 if (!TextTrack::isValidKindKeyword(kind)) { 2553 if (!TextTrack::isValidKindKeyword(kind)) {
2554 exceptionState.throwDOMException(SyntaxError, "The 'kind' provided ('" + kind + "') is invalid."); 2554 exceptionState.throwDOMException(SyntaxError, "The 'kind' provided ('" + kind + "') is invalid.");
2555 return 0; 2555 return nullptr;
2556 } 2556 }
2557 2557
2558 // 2. If the label argument was omitted, let label be the empty string. 2558 // 2. If the label argument was omitted, let label be the empty string.
2559 // 3. If the language argument was omitted, let language be the empty string . 2559 // 3. If the language argument was omitted, let language be the empty string .
2560 // 4. Create a new TextTrack object. 2560 // 4. Create a new TextTrack object.
2561 2561
2562 // 5. Create a new text track corresponding to the new object, and set its t ext track kind to kind, its text 2562 // 5. Create a new text track corresponding to the new object, and set its t ext track kind to kind, its text
2563 // track label to label, its text track language to language... 2563 // track label to label, its text track language to language...
2564 RefPtr<TextTrack> textTrack = TextTrack::create(document(), this, kind, labe l, language); 2564 RefPtr<TextTrack> textTrack = TextTrack::create(document(), this, kind, labe l, language);
2565 2565
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 } 2916 }
2917 2917
2918 if (canUseSourceElement) { 2918 if (canUseSourceElement) {
2919 if (contentType) 2919 if (contentType)
2920 *contentType = ContentType(type); 2920 *contentType = ContentType(type);
2921 if (keySystem) 2921 if (keySystem)
2922 *keySystem = system; 2922 *keySystem = system;
2923 m_currentSourceNode = source; 2923 m_currentSourceNode = source;
2924 m_nextChildNodeToConsider = source->nextSibling(); 2924 m_nextChildNodeToConsider = source->nextSibling();
2925 } else { 2925 } else {
2926 m_currentSourceNode = 0; 2926 m_currentSourceNode = nullptr;
2927 m_nextChildNodeToConsider = 0; 2927 m_nextChildNodeToConsider = nullptr;
2928 } 2928 }
2929 2929
2930 #if !LOG_DISABLED 2930 #if !LOG_DISABLED
2931 if (shouldLog) 2931 if (shouldLog)
2932 WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild -> %p, %s", m_cu rrentSourceNode.get(), canUseSourceElement ? urlForLoggingMedia(mediaURL).utf8() .data() : ""); 2932 WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild -> %p, %s", m_cu rrentSourceNode.get(), canUseSourceElement ? urlForLoggingMedia(mediaURL).utf8() .data() : "");
2933 #endif 2933 #endif
2934 return canUseSourceElement ? mediaURL : KURL(); 2934 return canUseSourceElement ? mediaURL : KURL();
2935 } 2935 }
2936 2936
2937 void HTMLMediaElement::sourceWasAdded(HTMLSourceElement* source) 2937 void HTMLMediaElement::sourceWasAdded(HTMLSourceElement* source)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 return; 2997 return;
2998 2998
2999 if (source == m_nextChildNodeToConsider) { 2999 if (source == m_nextChildNodeToConsider) {
3000 if (m_currentSourceNode) 3000 if (m_currentSourceNode)
3001 m_nextChildNodeToConsider = m_currentSourceNode->nextSibling(); 3001 m_nextChildNodeToConsider = m_currentSourceNode->nextSibling();
3002 WTF_LOG(Media, "HTMLMediaElement::sourceRemoved - m_nextChildNodeToConsi der set to %p", m_nextChildNodeToConsider.get()); 3002 WTF_LOG(Media, "HTMLMediaElement::sourceRemoved - m_nextChildNodeToConsi der set to %p", m_nextChildNodeToConsider.get());
3003 } else if (source == m_currentSourceNode) { 3003 } else if (source == m_currentSourceNode) {
3004 // Clear the current source node pointer, but don't change the movie as the spec says: 3004 // Clear the current source node pointer, but don't change the movie as the spec says:
3005 // 4.8.8 - Dynamically modifying a source element and its attribute when the element is already 3005 // 4.8.8 - Dynamically modifying a source element and its attribute when the element is already
3006 // inserted in a video or audio element will have no effect. 3006 // inserted in a video or audio element will have no effect.
3007 m_currentSourceNode = 0; 3007 m_currentSourceNode = nullptr;
3008 WTF_LOG(Media, "HTMLMediaElement::sourceRemoved - m_currentSourceNode se t to 0"); 3008 WTF_LOG(Media, "HTMLMediaElement::sourceRemoved - m_currentSourceNode se t to 0");
3009 } 3009 }
3010 } 3010 }
3011 3011
3012 void HTMLMediaElement::mediaPlayerTimeChanged() 3012 void HTMLMediaElement::mediaPlayerTimeChanged()
3013 { 3013 {
3014 WTF_LOG(Media, "HTMLMediaElement::mediaPlayerTimeChanged"); 3014 WTF_LOG(Media, "HTMLMediaElement::mediaPlayerTimeChanged");
3015 3015
3016 if (RuntimeEnabledFeatures::videoTrackEnabled()) 3016 if (RuntimeEnabledFeatures::videoTrackEnabled())
3017 updateActiveTextTrackCues(currentTime()); 3017 updateActiveTextTrackCues(currentTime());
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
3358 m_networkState = NETWORK_EMPTY; 3358 m_networkState = NETWORK_EMPTY;
3359 scheduleEvent(EventTypeNames::emptied); 3359 scheduleEvent(EventTypeNames::emptied);
3360 } 3360 }
3361 else 3361 else
3362 m_networkState = NETWORK_IDLE; 3362 m_networkState = NETWORK_IDLE;
3363 3363
3364 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event. 3364 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event.
3365 setShouldDelayLoadEvent(false); 3365 setShouldDelayLoadEvent(false);
3366 3366
3367 // 6 - Abort the overall resource selection algorithm. 3367 // 6 - Abort the overall resource selection algorithm.
3368 m_currentSourceNode = 0; 3368 m_currentSourceNode = nullptr;
3369 3369
3370 // Reset m_readyState since m_player is gone. 3370 // Reset m_readyState since m_player is gone.
3371 m_readyState = HAVE_NOTHING; 3371 m_readyState = HAVE_NOTHING;
3372 updateMediaController(); 3372 updateMediaController();
3373 if (RuntimeEnabledFeatures::videoTrackEnabled()) 3373 if (RuntimeEnabledFeatures::videoTrackEnabled())
3374 updateActiveTextTrackCues(0); 3374 updateActiveTextTrackCues(0);
3375 } 3375 }
3376 3376
3377 void HTMLMediaElement::clearMediaPlayerAndAudioSourceProviderClient() 3377 void HTMLMediaElement::clearMediaPlayerAndAudioSourceProviderClient()
3378 { 3378 {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
3740 { 3740 {
3741 return fastGetAttribute(mediagroupAttr); 3741 return fastGetAttribute(mediagroupAttr);
3742 } 3742 }
3743 3743
3744 void HTMLMediaElement::setMediaGroup(const AtomicString& group) 3744 void HTMLMediaElement::setMediaGroup(const AtomicString& group)
3745 { 3745 {
3746 // When a media element is created with a mediagroup attribute, and when a m edia element's mediagroup 3746 // When a media element is created with a mediagroup attribute, and when a m edia element's mediagroup
3747 // attribute is set, changed, or removed, the user agent must run the follow ing steps: 3747 // attribute is set, changed, or removed, the user agent must run the follow ing steps:
3748 // 1. Let m [this] be the media element in question. 3748 // 1. Let m [this] be the media element in question.
3749 // 2. Let m have no current media controller, if it currently has one. 3749 // 2. Let m have no current media controller, if it currently has one.
3750 setControllerInternal(0); 3750 setControllerInternal(nullptr);
3751 3751
3752 // 3. If m's mediagroup attribute is being removed, then abort these steps. 3752 // 3. If m's mediagroup attribute is being removed, then abort these steps.
3753 if (group.isNull() || group.isEmpty()) 3753 if (group.isNull() || group.isEmpty())
3754 return; 3754 return;
3755 3755
3756 // 4. If there is another media element whose Document is the same as m's Do cument (even if one or both 3756 // 4. If there is another media element whose Document is the same as m's Do cument (even if one or both
3757 // of these elements are not actually in the Document), 3757 // of these elements are not actually in the Document),
3758 HashSet<HTMLMediaElement*> elements = documentToElementSetMap().get(&documen t()); 3758 HashSet<HTMLMediaElement*> elements = documentToElementSetMap().get(&documen t());
3759 for (HashSet<HTMLMediaElement*>::iterator i = elements.begin(); i != element s.end(); ++i) { 3759 for (HashSet<HTMLMediaElement*>::iterator i = elements.begin(); i != element s.end(); ++i) {
3760 if (*i == this) 3760 if (*i == this)
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3917 { 3917 {
3918 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3918 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3919 } 3919 }
3920 3920
3921 bool HTMLMediaElement::isInteractiveContent() const 3921 bool HTMLMediaElement::isInteractiveContent() const
3922 { 3922 {
3923 return fastHasAttribute(controlsAttr); 3923 return fastHasAttribute(controlsAttr);
3924 } 3924 }
3925 3925
3926 } 3926 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698