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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 } | 964 } |
965 | 965 |
966 void HTMLMediaElement::loadSourceFromAttribute() | 966 void HTMLMediaElement::loadSourceFromAttribute() |
967 { | 967 { |
968 m_loadState = LoadingFromSrcAttr; | 968 m_loadState = LoadingFromSrcAttr; |
969 const AtomicString& srcValue = fastGetAttribute(srcAttr); | 969 const AtomicString& srcValue = fastGetAttribute(srcAttr); |
970 | 970 |
971 // If the src attribute's value is the empty string ... jump down to the fai
led step below | 971 // If the src attribute's value is the empty string ... jump down to the fai
led step below |
972 if (srcValue.isEmpty()) { | 972 if (srcValue.isEmpty()) { |
973 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); | 973 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); |
974 BLINK_MEDIA_LOG << "selectMediaResource(" << (void*)this << "), empty 's
rc'"; | 974 BLINK_MEDIA_LOG << "loadSourceFromAttribute(" << (void*)this << "), empt
y 'src'"; |
975 return; | 975 return; |
976 } | 976 } |
977 | 977 |
978 KURL mediaURL = document().completeURL(srcValue); | 978 KURL mediaURL = document().completeURL(srcValue); |
979 if (!isSafeToLoadURL(mediaURL, Complain)) { | 979 if (!isSafeToLoadURL(mediaURL, Complain)) { |
980 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); | 980 mediaLoadingFailed(WebMediaPlayer::NetworkStateFormatError); |
981 return; | 981 return; |
982 } | 982 } |
983 | 983 |
984 // No type is available when the url comes from the 'src' attribute so | 984 // No type is available when the url comes from the 'src' attribute so |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 | 1430 |
1431 // If we failed while trying to load a <source> element, the movie was never
parsed, and there are more | 1431 // If we failed while trying to load a <source> element, the movie was never
parsed, and there are more |
1432 // <source> children, schedule the next one | 1432 // <source> children, schedule the next one |
1433 if (m_readyState < kHaveMetadata && m_loadState == LoadingFromSourceElement)
{ | 1433 if (m_readyState < kHaveMetadata && m_loadState == LoadingFromSourceElement)
{ |
1434 | 1434 |
1435 // resource selection algorithm | 1435 // resource selection algorithm |
1436 // Step 9.Otherwise.9 - Failed with elements: Queue a task, using the DO
M manipulation task source, to fire a simple event named error at the candidate
element. | 1436 // Step 9.Otherwise.9 - Failed with elements: Queue a task, using the DO
M manipulation task source, to fire a simple event named error at the candidate
element. |
1437 if (m_currentSourceNode) | 1437 if (m_currentSourceNode) |
1438 m_currentSourceNode->scheduleErrorEvent(); | 1438 m_currentSourceNode->scheduleErrorEvent(); |
1439 else | 1439 else |
1440 BLINK_MEDIA_LOG << "setNetworkState(" << (void*)this << ") - error e
vent not sent, <source> was removed"; | 1440 BLINK_MEDIA_LOG << "mediaLoadingFailed(" << (void*)this << ") - erro
r event not sent, <source> was removed"; |
1441 | 1441 |
1442 // 9.Otherwise.10 - Asynchronously await a stable state. The synchronous
section consists of all the remaining steps of this algorithm until the algorit
hm says the synchronous section has ended. | 1442 // 9.Otherwise.10 - Asynchronously await a stable state. The synchronous
section consists of all the remaining steps of this algorithm until the algorit
hm says the synchronous section has ended. |
1443 | 1443 |
1444 // 9.Otherwise.11 - Forget the media element's media-resource-specific t
racks. | 1444 // 9.Otherwise.11 - Forget the media element's media-resource-specific t
racks. |
1445 forgetResourceSpecificTracks(); | 1445 forgetResourceSpecificTracks(); |
1446 | 1446 |
1447 if (havePotentialSourceChild()) { | 1447 if (havePotentialSourceChild()) { |
1448 BLINK_MEDIA_LOG << "setNetworkState(" << (void*)this << ") - schedul
ing next <source>"; | 1448 BLINK_MEDIA_LOG << "mediaLoadingFailed(" << (void*)this << ") - sche
duling next <source>"; |
1449 scheduleNextSourceChild(); | 1449 scheduleNextSourceChild(); |
1450 } else { | 1450 } else { |
1451 BLINK_MEDIA_LOG << "setNetworkState(" << (void*)this << ") - no more
<source> elements, waiting"; | 1451 BLINK_MEDIA_LOG << "mediaLoadingFailed(" << (void*)this << ") - no m
ore <source> elements, waiting"; |
1452 waitForSourceChange(); | 1452 waitForSourceChange(); |
1453 } | 1453 } |
1454 | 1454 |
1455 return; | 1455 return; |
1456 } | 1456 } |
1457 | 1457 |
1458 if (error == WebMediaPlayer::NetworkStateNetworkError && m_readyState >= kHa
veMetadata) | 1458 if (error == WebMediaPlayer::NetworkStateNetworkError && m_readyState >= kHa
veMetadata) |
1459 mediaEngineError(MediaError::create(MediaError::kMediaErrNetwork)); | 1459 mediaEngineError(MediaError::create(MediaError::kMediaErrNetwork)); |
1460 else if (error == WebMediaPlayer::NetworkStateDecodeError) | 1460 else if (error == WebMediaPlayer::NetworkStateDecodeError) |
1461 mediaEngineError(MediaError::create(MediaError::kMediaErrDecode)); | 1461 mediaEngineError(MediaError::create(MediaError::kMediaErrDecode)); |
(...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4022 | 4022 |
4023 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst | 4023 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst |
4024 { | 4024 { |
4025 IntRect result; | 4025 IntRect result; |
4026 if (LayoutObject* object = m_element->layoutObject()) | 4026 if (LayoutObject* object = m_element->layoutObject()) |
4027 result = object->absoluteBoundingBoxRect(); | 4027 result = object->absoluteBoundingBoxRect(); |
4028 return result; | 4028 return result; |
4029 } | 4029 } |
4030 | 4030 |
4031 } // namespace blink | 4031 } // namespace blink |
OLD | NEW |