| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef HTMLMediaElement_h | 27 #ifndef HTMLMediaElement_h |
| 28 #define HTMLMediaElement_h | 28 #define HTMLMediaElement_h |
| 29 | 29 |
| 30 #include "bindings/core/v8/ActiveScriptWrappable.h" | 30 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 31 #include "bindings/core/v8/ScriptPromise.h" | 31 #include "bindings/core/v8/ScriptPromise.h" |
| 32 #include "bindings/core/v8/TraceWrapperMember.h" | 32 #include "bindings/core/v8/TraceWrapperMember.h" |
| 33 #include "core/CoreExport.h" | 33 #include "core/CoreExport.h" |
| 34 #include "core/dom/ActiveDOMObject.h" | |
| 35 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
| 35 #include "core/dom/SuspendableObject.h" |
| 36 #include "core/events/GenericEventQueue.h" | 36 #include "core/events/GenericEventQueue.h" |
| 37 #include "core/html/HTMLElement.h" | 37 #include "core/html/HTMLElement.h" |
| 38 #include "core/html/track/TextTrack.h" | 38 #include "core/html/track/TextTrack.h" |
| 39 #include "platform/Supplementable.h" | 39 #include "platform/Supplementable.h" |
| 40 #include "platform/WebTaskRunner.h" | 40 #include "platform/WebTaskRunner.h" |
| 41 #include "platform/audio/AudioSourceProvider.h" | 41 #include "platform/audio/AudioSourceProvider.h" |
| 42 #include "platform/network/mime/MIMETypeRegistry.h" | 42 #include "platform/network/mime/MIMETypeRegistry.h" |
| 43 #include "public/platform/WebAudioSourceProviderClient.h" | 43 #include "public/platform/WebAudioSourceProviderClient.h" |
| 44 #include "public/platform/WebMediaPlayerClient.h" | 44 #include "public/platform/WebMediaPlayerClient.h" |
| 45 #include <memory> | 45 #include <memory> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 71 class VideoTrack; | 71 class VideoTrack; |
| 72 class VideoTrackList; | 72 class VideoTrackList; |
| 73 class WebAudioSourceProvider; | 73 class WebAudioSourceProvider; |
| 74 class WebInbandTextTrack; | 74 class WebInbandTextTrack; |
| 75 class WebLayer; | 75 class WebLayer; |
| 76 class WebRemotePlaybackClient; | 76 class WebRemotePlaybackClient; |
| 77 | 77 |
| 78 class CORE_EXPORT HTMLMediaElement : public HTMLElement, | 78 class CORE_EXPORT HTMLMediaElement : public HTMLElement, |
| 79 public Supplementable<HTMLMediaElement>, | 79 public Supplementable<HTMLMediaElement>, |
| 80 public ActiveScriptWrappable, | 80 public ActiveScriptWrappable, |
| 81 public ActiveDOMObject, | 81 public SuspendableObject, |
| 82 private WebMediaPlayerClient { | 82 private WebMediaPlayerClient { |
| 83 DEFINE_WRAPPERTYPEINFO(); | 83 DEFINE_WRAPPERTYPEINFO(); |
| 84 USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); | 84 USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); |
| 85 USING_PRE_FINALIZER(HTMLMediaElement, dispose); | 85 USING_PRE_FINALIZER(HTMLMediaElement, dispose); |
| 86 | 86 |
| 87 public: | 87 public: |
| 88 static MIMETypeRegistry::SupportsType supportsType(const ContentType&); | 88 static MIMETypeRegistry::SupportsType supportsType(const ContentType&); |
| 89 | 89 |
| 90 enum class RecordMetricsBehavior { DoNotRecord, DoRecord }; | 90 enum class RecordMetricsBehavior { DoNotRecord, DoRecord }; |
| 91 | 91 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 bool textTracksAreReady() const; | 235 bool textTracksAreReady() const; |
| 236 void configureTextTrackDisplay(); | 236 void configureTextTrackDisplay(); |
| 237 void updateTextTrackDisplay(); | 237 void updateTextTrackDisplay(); |
| 238 double lastSeekTime() const { return m_lastSeekTime; } | 238 double lastSeekTime() const { return m_lastSeekTime; } |
| 239 void textTrackReadyStateChanged(TextTrack*); | 239 void textTrackReadyStateChanged(TextTrack*); |
| 240 | 240 |
| 241 void textTrackModeChanged(TextTrack*); | 241 void textTrackModeChanged(TextTrack*); |
| 242 void disableAutomaticTextTrackSelection(); | 242 void disableAutomaticTextTrackSelection(); |
| 243 | 243 |
| 244 // EventTarget function. | 244 // EventTarget function. |
| 245 // Both Node (via HTMLElement) and ActiveDOMObject define this method, which | 245 // Both Node (via HTMLElement) and SuspendableObject define this method, which |
| 246 // causes an ambiguity error at compile time. This class's constructor | 246 // causes an ambiguity error at compile time. This class's constructor |
| 247 // ensures that both implementations return document, so return the result | 247 // ensures that both implementations return document, so return the result |
| 248 // of one of them here. | 248 // of one of them here. |
| 249 using HTMLElement::getExecutionContext; | 249 using HTMLElement::getExecutionContext; |
| 250 | 250 |
| 251 bool hasSingleSecurityOrigin() const { | 251 bool hasSingleSecurityOrigin() const { |
| 252 return webMediaPlayer() && webMediaPlayer()->hasSingleSecurityOrigin(); | 252 return webMediaPlayer() && webMediaPlayer()->hasSingleSecurityOrigin(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 bool isFullscreen() const; | 255 bool isFullscreen() const; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 LayoutObject* createLayoutObject(const ComputedStyle&) override; | 347 LayoutObject* createLayoutObject(const ComputedStyle&) override; |
| 348 InsertionNotificationRequest insertedInto(ContainerNode*) final; | 348 InsertionNotificationRequest insertedInto(ContainerNode*) final; |
| 349 void didNotifySubtreeInsertionsToDocument() override; | 349 void didNotifySubtreeInsertionsToDocument() override; |
| 350 void removedFrom(ContainerNode*) final; | 350 void removedFrom(ContainerNode*) final; |
| 351 void didRecalcStyle(StyleRecalcChange) final; | 351 void didRecalcStyle(StyleRecalcChange) final; |
| 352 | 352 |
| 353 bool canStartSelection() const override { return false; } | 353 bool canStartSelection() const override { return false; } |
| 354 | 354 |
| 355 bool isInteractiveContent() const final; | 355 bool isInteractiveContent() const final; |
| 356 | 356 |
| 357 // ActiveDOMObject functions. | 357 // SuspendableObject functions. |
| 358 void contextDestroyed() final; | 358 void contextDestroyed() final; |
| 359 | 359 |
| 360 virtual void updateDisplayState() {} | 360 virtual void updateDisplayState() {} |
| 361 | 361 |
| 362 void setReadyState(ReadyState); | 362 void setReadyState(ReadyState); |
| 363 void setNetworkState(WebMediaPlayer::NetworkState); | 363 void setNetworkState(WebMediaPlayer::NetworkState); |
| 364 | 364 |
| 365 // WebMediaPlayerClient implementation. | 365 // WebMediaPlayerClient implementation. |
| 366 void networkStateChanged() final; | 366 void networkStateChanged() final; |
| 367 void readyStateChanged() final; | 367 void readyStateChanged() final; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 | 739 |
| 740 inline bool isHTMLMediaElement(const HTMLElement& element) { | 740 inline bool isHTMLMediaElement(const HTMLElement& element) { |
| 741 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 741 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 742 } | 742 } |
| 743 | 743 |
| 744 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 744 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 745 | 745 |
| 746 } // namespace blink | 746 } // namespace blink |
| 747 | 747 |
| 748 #endif // HTMLMediaElement_h | 748 #endif // HTMLMediaElement_h |
| OLD | NEW |