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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 #include "wtf/MathExtras.h" | 78 #include "wtf/MathExtras.h" |
79 #include "wtf/NonCopyingSort.h" | 79 #include "wtf/NonCopyingSort.h" |
80 #include "wtf/Uint8Array.h" | 80 #include "wtf/Uint8Array.h" |
81 #include "wtf/text/CString.h" | 81 #include "wtf/text/CString.h" |
82 | 82 |
83 #if ENABLE(WEB_AUDIO) | 83 #if ENABLE(WEB_AUDIO) |
84 #include "platform/audio/AudioSourceProvider.h" | 84 #include "platform/audio/AudioSourceProvider.h" |
85 #include "modules/webaudio/MediaElementAudioSourceNode.h" | 85 #include "modules/webaudio/MediaElementAudioSourceNode.h" |
86 #endif | 86 #endif |
87 | 87 |
88 #if ENABLE(ENCRYPTED_MEDIA_V2) | |
89 // FIXME: Remove dependency on modules/encryptedmedia (http://crbug.com/242754). | 88 // FIXME: Remove dependency on modules/encryptedmedia (http://crbug.com/242754). |
90 #include "modules/encryptedmedia/MediaKeyNeededEvent.h" | 89 #include "modules/encryptedmedia/MediaKeyNeededEvent.h" |
91 #include "modules/encryptedmedia/MediaKeys.h" | 90 #include "modules/encryptedmedia/MediaKeys.h" |
abarth-chromium
2013/12/15 06:11:55
Please alphabetize these headers with the rest of
| |
92 #endif | |
93 | 91 |
94 using namespace std; | 92 using namespace std; |
95 using blink::WebInbandTextTrack; | 93 using blink::WebInbandTextTrack; |
96 using blink::WebMimeRegistry; | 94 using blink::WebMimeRegistry; |
97 | 95 |
98 namespace WebCore { | 96 namespace WebCore { |
99 | 97 |
100 #if !LOG_DISABLED | 98 #if !LOG_DISABLED |
101 static String urlForLoggingMedia(const KURL& url) | 99 static String urlForLoggingMedia(const KURL& url) |
102 { | 100 { |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 m_textTracks->item(i)->clearClient(); | 333 m_textTracks->item(i)->clearClient(); |
336 } | 334 } |
337 | 335 |
338 if (m_mediaController) { | 336 if (m_mediaController) { |
339 m_mediaController->removeMediaElement(this); | 337 m_mediaController->removeMediaElement(this); |
340 m_mediaController = 0; | 338 m_mediaController = 0; |
341 } | 339 } |
342 | 340 |
343 closeMediaSource(); | 341 closeMediaSource(); |
344 | 342 |
345 #if ENABLE(ENCRYPTED_MEDIA_V2) | |
346 setMediaKeys(0); | 343 setMediaKeys(0); |
347 #endif | |
348 | 344 |
349 removeElementFromDocumentMap(this, &document()); | 345 removeElementFromDocumentMap(this, &document()); |
350 | 346 |
351 // Destroying the player may cause a resource load to be canceled, | 347 // Destroying the player may cause a resource load to be canceled, |
352 // which could result in userCancelledLoad() being called back. | 348 // which could result in userCancelledLoad() being called back. |
353 // Setting m_completelyLoaded ensures that such a call will not cause | 349 // Setting m_completelyLoaded ensures that such a call will not cause |
354 // us to dispatch an abort event, which would result in a crash. | 350 // us to dispatch an abort event, which would result in a crash. |
355 // See http://crbug.com/233654 for more details. | 351 // See http://crbug.com/233654 for more details. |
356 m_completelyLoaded = true; | 352 m_completelyLoaded = true; |
357 | 353 |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1720 initializer.initData = Uint8Array::create(initData, initDataLength); | 1716 initializer.initData = Uint8Array::create(initData, initDataLength); |
1721 initializer.bubbles = false; | 1717 initializer.bubbles = false; |
1722 initializer.cancelable = false; | 1718 initializer.cancelable = false; |
1723 | 1719 |
1724 RefPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitneedkey, i nitializer); | 1720 RefPtr<Event> event = MediaKeyEvent::create(EventTypeNames::webkitneedkey, i nitializer); |
1725 event->setTarget(this); | 1721 event->setTarget(this); |
1726 m_asyncEventQueue->enqueueEvent(event.release()); | 1722 m_asyncEventQueue->enqueueEvent(event.release()); |
1727 return true; | 1723 return true; |
1728 } | 1724 } |
1729 | 1725 |
1730 #if ENABLE(ENCRYPTED_MEDIA_V2) | |
1731 bool HTMLMediaElement::mediaPlayerKeyNeeded(Uint8Array* initData) | 1726 bool HTMLMediaElement::mediaPlayerKeyNeeded(Uint8Array* initData) |
1732 { | 1727 { |
1733 if (!hasEventListeners("webkitneedkey")) { | 1728 if (!hasEventListeners("webkitneedkey")) { |
1734 m_error = MediaError::create(MediaError::MEDIA_ERR_ENCRYPTED); | 1729 m_error = MediaError::create(MediaError::MEDIA_ERR_ENCRYPTED); |
1735 scheduleEvent(EventTypeNames::error); | 1730 scheduleEvent(EventTypeNames::error); |
1736 return false; | 1731 return false; |
1737 } | 1732 } |
1738 | 1733 |
1739 MediaKeyNeededEventInit initializer; | 1734 MediaKeyNeededEventInit initializer; |
1740 initializer.initData = initData; | 1735 initializer.initData = initData; |
(...skipping 11 matching lines...) Expand all Loading... | |
1752 { | 1747 { |
1753 if (m_mediaKeys == mediaKeys) | 1748 if (m_mediaKeys == mediaKeys) |
1754 return; | 1749 return; |
1755 | 1750 |
1756 if (m_mediaKeys) | 1751 if (m_mediaKeys) |
1757 m_mediaKeys->setMediaElement(0); | 1752 m_mediaKeys->setMediaElement(0); |
1758 m_mediaKeys = mediaKeys; | 1753 m_mediaKeys = mediaKeys; |
1759 if (m_mediaKeys) | 1754 if (m_mediaKeys) |
1760 m_mediaKeys->setMediaElement(this); | 1755 m_mediaKeys->setMediaElement(this); |
1761 } | 1756 } |
1762 #endif | |
1763 | 1757 |
1764 void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*) | 1758 void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*) |
1765 { | 1759 { |
1766 ASSERT(m_player); | 1760 ASSERT(m_player); |
1767 if (m_networkState != NETWORK_LOADING) | 1761 if (m_networkState != NETWORK_LOADING) |
1768 return; | 1762 return; |
1769 | 1763 |
1770 double time = WTF::currentTime(); | 1764 double time = WTF::currentTime(); |
1771 double timedelta = time - m_previousProgressTime; | 1765 double timedelta = time - m_previousProgressTime; |
1772 | 1766 |
(...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3915 if (m_webLayer) | 3909 if (m_webLayer) |
3916 m_webLayer->setOpaque(m_opaque); | 3910 m_webLayer->setOpaque(m_opaque); |
3917 } | 3911 } |
3918 | 3912 |
3919 bool HTMLMediaElement::isInteractiveContent() const | 3913 bool HTMLMediaElement::isInteractiveContent() const |
3920 { | 3914 { |
3921 return fastHasAttribute(controlsAttr); | 3915 return fastHasAttribute(controlsAttr); |
3922 } | 3916 } |
3923 | 3917 |
3924 } | 3918 } |
OLD | NEW |