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

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

Issue 330593005: HTMLMediaElement::webMediaPlayer() should never be null if m_readyState >= HAVE_METADATA (media eng… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review comments Created 6 years, 6 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
« no previous file with comments | « LayoutTests/http/tests/media/video-load-metadata-decode-error-expected.txt ('k') | no next file » | 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 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 // the element won't attempt to load another resource. 1453 // the element won't attempt to load another resource.
1454 1454
1455 updateDisplayState(); 1455 updateDisplayState();
1456 1456
1457 if (renderer()) 1457 if (renderer())
1458 renderer()->updateFromElement(); 1458 renderer()->updateFromElement();
1459 } 1459 }
1460 1460
1461 void HTMLMediaElement::mediaEngineError(PassRefPtrWillBeRawPtr<MediaError> err) 1461 void HTMLMediaElement::mediaEngineError(PassRefPtrWillBeRawPtr<MediaError> err)
1462 { 1462 {
1463 ASSERT(m_readyState >= HAVE_METADATA);
1463 WTF_LOG(Media, "HTMLMediaElement::mediaEngineError(%d)", static_cast<int>(er r->code())); 1464 WTF_LOG(Media, "HTMLMediaElement::mediaEngineError(%d)", static_cast<int>(er r->code()));
1464 1465
1465 // 1 - The user agent should cancel the fetching process. 1466 // 1 - The user agent should cancel the fetching process.
1466 stopPeriodicTimers(); 1467 stopPeriodicTimers();
1467 m_loadState = WaitingForSource; 1468 m_loadState = WaitingForSource;
1468 1469
1469 // 2 - Set the error attribute to a new MediaError object whose code attribu te is 1470 // 2 - Set the error attribute to a new MediaError object whose code attribu te is
1470 // set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE. 1471 // set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE.
1471 m_error = err; 1472 m_error = err;
1472 1473
1473 // 3 - Queue a task to fire a simple event named error at the media element. 1474 // 3 - Queue a task to fire a simple event named error at the media element.
1474 scheduleEvent(EventTypeNames::error); 1475 scheduleEvent(EventTypeNames::error);
1475 1476
1476 closeMediaSource(); 1477 closeMediaSource();
1477 1478
1478 // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value a nd queue a 1479 // 4 - Set the element's networkState attribute to the NETWORK_IDLE value an d queue a
1479 // task to fire a simple event called emptied at the element. 1480 // task to fire a simple event called emptied at the element.
1480 m_networkState = NETWORK_EMPTY; 1481 m_networkState = NETWORK_IDLE;
1481 scheduleEvent(EventTypeNames::emptied); 1482 scheduleEvent(EventTypeNames::emptied);
philipj_slow 2014/06/18 13:52:14 If we are to match what the spec will probably com
Srirama 2014/06/18 14:15:08 Done.
1482 1483
1483 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event. 1484 // 5 - Set the element's delaying-the-load-event flag to false. This stops d elaying the load event.
1484 setShouldDelayLoadEvent(false); 1485 setShouldDelayLoadEvent(false);
1485 1486
1486 // 6 - Abort the overall resource selection algorithm. 1487 // 6 - Abort the overall resource selection algorithm.
1487 m_currentSourceNode = nullptr; 1488 m_currentSourceNode = nullptr;
1488 } 1489 }
1489 1490
1490 void HTMLMediaElement::cancelPendingEventsAndCallbacks() 1491 void HTMLMediaElement::cancelPendingEventsAndCallbacks()
1491 { 1492 {
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after
3673 3674
3674 #if ENABLE(WEB_AUDIO) 3675 #if ENABLE(WEB_AUDIO)
3675 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) 3676 void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
3676 { 3677 {
3677 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) 3678 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider())
3678 audioSourceProvider()->setClient(0); 3679 audioSourceProvider()->setClient(0);
3679 } 3680 }
3680 #endif 3681 #endif
3681 3682
3682 } 3683 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/media/video-load-metadata-decode-error-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698