| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 AudioSourceProviderClient* audioSourceNode() { return m_audioSourceNode; } | 259 AudioSourceProviderClient* audioSourceNode() { return m_audioSourceNode; } |
| 260 void setAudioSourceNode(AudioSourceProviderClient*); | 260 void setAudioSourceNode(AudioSourceProviderClient*); |
| 261 | 261 |
| 262 AudioSourceProvider* audioSourceProvider(); | 262 AudioSourceProvider* audioSourceProvider(); |
| 263 #endif | 263 #endif |
| 264 | 264 |
| 265 enum InvalidURLAction { DoNothing, Complain }; | 265 enum InvalidURLAction { DoNothing, Complain }; |
| 266 bool isSafeToLoadURL(const KURL&, InvalidURLAction); | 266 bool isSafeToLoadURL(const KURL&, InvalidURLAction); |
| 267 | 267 |
| 268 MediaController* controller() const; | 268 MediaController* controller() const; |
| 269 void setController(PassRefPtr<MediaController>); // Resets the MediaGroup an
d sets the MediaController. | 269 void setController(PassRefPtrWillBeRawPtr<MediaController>); // Resets the M
ediaGroup and sets the MediaController. |
| 270 | 270 |
| 271 void scheduleEvent(PassRefPtrWillBeRawPtr<Event>); | 271 void scheduleEvent(PassRefPtrWillBeRawPtr<Event>); |
| 272 | 272 |
| 273 // Current volume that should be used by the webMediaPlayer(). This method t
akes muted state | 273 // Current volume that should be used by the webMediaPlayer(). This method t
akes muted state |
| 274 // and m_mediaController multipliers into account. | 274 // and m_mediaController multipliers into account. |
| 275 double playerVolume() const; | 275 double playerVolume() const; |
| 276 | 276 |
| 277 #if ENABLE(OILPAN) | |
| 278 bool isFinalizing() const { return m_isFinalizing; } | |
| 279 #endif | |
| 280 | |
| 281 protected: | 277 protected: |
| 282 HTMLMediaElement(const QualifiedName&, Document&); | 278 HTMLMediaElement(const QualifiedName&, Document&); |
| 283 virtual ~HTMLMediaElement(); | 279 virtual ~HTMLMediaElement(); |
| 284 | 280 |
| 285 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 281 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 286 virtual void finishParsingChildren() OVERRIDE FINAL; | 282 virtual void finishParsingChildren() OVERRIDE FINAL; |
| 287 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 283 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; |
| 288 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 284 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; |
| 289 | 285 |
| 290 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; | 286 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; |
| 291 | 287 |
| 292 enum DisplayMode { Unknown, Poster, PosterWaitingForVideo, Video }; | 288 enum DisplayMode { Unknown, Poster, PosterWaitingForVideo, Video }; |
| 293 DisplayMode displayMode() const { return m_displayMode; } | 289 DisplayMode displayMode() const { return m_displayMode; } |
| 294 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | 290 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } |
| 295 | 291 |
| 296 void setControllerInternal(PassRefPtr<MediaController>); | 292 void setControllerInternal(PassRefPtrWillBeRawPtr<MediaController>); |
| 297 | 293 |
| 298 bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayU
pdate > 0; } | 294 bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayU
pdate > 0; } |
| 299 void beginIgnoringTrackDisplayUpdateRequests(); | 295 void beginIgnoringTrackDisplayUpdateRequests(); |
| 300 void endIgnoringTrackDisplayUpdateRequests(); | 296 void endIgnoringTrackDisplayUpdateRequests(); |
| 301 | 297 |
| 302 private: | 298 private: |
| 303 void createMediaPlayer(); | 299 void createMediaPlayer(); |
| 304 | 300 |
| 305 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE FINAL { return
true; } | 301 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE FINAL { return
true; } |
| 306 virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false;
} | 302 virtual bool areAuthorShadowsAllowed() const OVERRIDE FINAL { return false;
} |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 448 |
| 453 // The last time a timeupdate event was sent in movie time. | 449 // The last time a timeupdate event was sent in movie time. |
| 454 double m_lastTimeUpdateEventMovieTime; | 450 double m_lastTimeUpdateEventMovieTime; |
| 455 | 451 |
| 456 // Loading state. | 452 // Loading state. |
| 457 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem
ent }; | 453 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem
ent }; |
| 458 LoadState m_loadState; | 454 LoadState m_loadState; |
| 459 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; | 455 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; |
| 460 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; | 456 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; |
| 461 | 457 |
| 462 OwnPtr<MediaPlayer> m_player; | 458 OwnPtrWillBeMember<MediaPlayer> m_player; |
| 463 blink::WebLayer* m_webLayer; | 459 blink::WebLayer* m_webLayer; |
| 464 | 460 |
| 465 MediaPlayer::Preload m_preload; | 461 MediaPlayer::Preload m_preload; |
| 466 | 462 |
| 467 DisplayMode m_displayMode; | 463 DisplayMode m_displayMode; |
| 468 | 464 |
| 469 RefPtr<HTMLMediaSource> m_mediaSource; | 465 RefPtr<HTMLMediaSource> m_mediaSource; |
| 470 | 466 |
| 471 mutable double m_cachedTime; | 467 mutable double m_cachedTime; |
| 472 mutable double m_cachedTimeWallClockUpdateTime; | 468 mutable double m_cachedTimeWallClockUpdateTime; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 499 | 495 |
| 500 bool m_closedCaptionsVisible : 1; | 496 bool m_closedCaptionsVisible : 1; |
| 501 | 497 |
| 502 bool m_completelyLoaded : 1; | 498 bool m_completelyLoaded : 1; |
| 503 bool m_havePreparedToPlay : 1; | 499 bool m_havePreparedToPlay : 1; |
| 504 bool m_delayingLoadForPreloadNone : 1; | 500 bool m_delayingLoadForPreloadNone : 1; |
| 505 | 501 |
| 506 bool m_tracksAreReady : 1; | 502 bool m_tracksAreReady : 1; |
| 507 bool m_haveVisibleTextTrack : 1; | 503 bool m_haveVisibleTextTrack : 1; |
| 508 bool m_processingPreferenceChange : 1; | 504 bool m_processingPreferenceChange : 1; |
| 509 #if ENABLE(OILPAN) | |
| 510 bool m_isFinalizing : 1; | |
| 511 #endif | |
| 512 double m_lastTextTrackUpdateTime; | 505 double m_lastTextTrackUpdateTime; |
| 513 | 506 |
| 514 RefPtrWillBeMember<TextTrackList> m_textTracks; | 507 RefPtrWillBeMember<TextTrackList> m_textTracks; |
| 515 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_textTracksWhenResourceSel
ectionBegan; | 508 WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_textTracksWhenResourceSel
ectionBegan; |
| 516 | 509 |
| 517 CueIntervalTree m_cueTree; | 510 CueIntervalTree m_cueTree; |
| 518 | 511 |
| 519 CueList m_currentlyActiveCues; | 512 CueList m_currentlyActiveCues; |
| 520 int m_ignoreTrackDisplayUpdate; | 513 int m_ignoreTrackDisplayUpdate; |
| 521 | 514 |
| 522 #if ENABLE(WEB_AUDIO) | 515 #if ENABLE(WEB_AUDIO) |
| 523 // This is a weak reference, since m_audioSourceNode holds a reference to us
. | 516 // This is a weak reference, since m_audioSourceNode holds a reference to us
. |
| 524 AudioSourceProviderClient* m_audioSourceNode; | 517 AudioSourceProviderClient* m_audioSourceNode; |
| 525 #endif | 518 #endif |
| 526 | 519 |
| 527 friend class MediaController; | 520 friend class MediaController; |
| 528 RefPtr<MediaController> m_mediaController; | 521 RefPtrWillBeMember<MediaController> m_mediaController; |
| 529 | 522 |
| 530 friend class Internals; | 523 friend class Internals; |
| 531 friend class TrackDisplayUpdateScope; | 524 friend class TrackDisplayUpdateScope; |
| 532 | 525 |
| 533 static URLRegistry* s_mediaStreamRegistry; | 526 static URLRegistry* s_mediaStreamRegistry; |
| 534 }; | 527 }; |
| 535 | 528 |
| 536 #ifndef NDEBUG | 529 #ifndef NDEBUG |
| 537 // Template specializations required by PodIntervalTree in debug mode. | 530 // Template specializations required by PodIntervalTree in debug mode. |
| 538 template <> | 531 template <> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 560 inline bool isHTMLMediaElement(const HTMLElement& element) | 553 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 561 { | 554 { |
| 562 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 555 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 563 } | 556 } |
| 564 | 557 |
| 565 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 558 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 566 | 559 |
| 567 } //namespace | 560 } //namespace |
| 568 | 561 |
| 569 #endif | 562 #endif |
| OLD | NEW |