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

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

Issue 545933002: Implement HTMLMediaElement::srcObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase only Created 6 years, 3 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
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #endif 52 #endif
53 class AudioTrackList; 53 class AudioTrackList;
54 class ContentType; 54 class ContentType;
55 class Event; 55 class Event;
56 class ExceptionState; 56 class ExceptionState;
57 class HTMLSourceElement; 57 class HTMLSourceElement;
58 class HTMLTrackElement; 58 class HTMLTrackElement;
59 class KURL; 59 class KURL;
60 class MediaController; 60 class MediaController;
61 class MediaControls; 61 class MediaControls;
62 class MediaProvider;
62 class MediaError; 63 class MediaError;
63 class HTMLMediaSource; 64 class HTMLMediaSource;
64 class TextTrackList; 65 class TextTrackList;
65 class TimeRanges; 66 class TimeRanges;
66 class URLRegistry; 67 class URLRegistry;
67 class VideoTrackList; 68 class VideoTrackList;
68 69
69 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; 70 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree;
70 typedef CueIntervalTree::IntervalType CueInterval; 71 typedef CueIntervalTree::IntervalType CueInterval;
71 typedef Vector<CueInterval> CueList; 72 typedef Vector<CueInterval> CueList;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 }; 105 };
105 void scheduleDelayedAction(DelayedActionType); 106 void scheduleDelayedAction(DelayedActionType);
106 107
107 bool isActive() const { return m_active; } 108 bool isActive() const { return m_active; }
108 109
109 // error state 110 // error state
110 PassRefPtrWillBeRawPtr<MediaError> error() const; 111 PassRefPtrWillBeRawPtr<MediaError> error() const;
111 112
112 // network state 113 // network state
113 void setSrc(const AtomicString&); 114 void setSrc(const AtomicString&);
115 void setSrcObject(RawPtr<MediaProvider>);
116 MediaProvider* srcObject() const;
114 const KURL& currentSrc() const { return m_currentSrc; } 117 const KURL& currentSrc() const { return m_currentSrc; }
115 118
116 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE }; 119 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE };
117 NetworkState networkState() const; 120 NetworkState networkState() const;
118 121
119 String preload() const; 122 String preload() const;
120 void setPreload(const AtomicString&); 123 void setPreload(const AtomicString&);
121 124
122 PassRefPtrWillBeRawPtr<TimeRanges> buffered() const; 125 PassRefPtrWillBeRawPtr<TimeRanges> buffered() const;
123 void load(); 126 void load();
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 385
383 // loading 386 // loading
384 void prepareForLoad(); 387 void prepareForLoad();
385 void loadInternal(); 388 void loadInternal();
386 void selectMediaResource(); 389 void selectMediaResource();
387 void loadResource(const KURL&, ContentType&, const String& keySystem); 390 void loadResource(const KURL&, ContentType&, const String& keySystem);
388 void startPlayerLoad(); 391 void startPlayerLoad();
389 void setPlayerPreload(); 392 void setPlayerPreload();
390 blink::WebMediaPlayer::LoadType loadType() const; 393 blink::WebMediaPlayer::LoadType loadType() const;
391 void scheduleNextSourceChild(); 394 void scheduleNextSourceChild();
395 void loadSourceFromObject();
396 void loadSourceFromAttribute();
392 void loadNextSourceChild(); 397 void loadNextSourceChild();
393 void userCancelledLoad(); 398 void userCancelledLoad();
394 void clearMediaPlayer(int flags); 399 void clearMediaPlayer(int flags);
395 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); 400 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
396 bool havePotentialSourceChild(); 401 bool havePotentialSourceChild();
397 void noneSupported(); 402 void noneSupported();
398 void mediaEngineError(PassRefPtrWillBeRawPtr<MediaError>); 403 void mediaEngineError(PassRefPtrWillBeRawPtr<MediaError>);
399 void cancelPendingEventsAndCallbacks(); 404 void cancelPendingEventsAndCallbacks();
400 void waitForSourceChange(); 405 void waitForSourceChange();
401 void prepareToPlay(); 406 void prepareToPlay();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 // Cached duration to suppress duplicate events if duration unchanged. 504 // Cached duration to suppress duplicate events if duration unchanged.
500 double m_duration; 505 double m_duration;
501 506
502 // The last time a timeupdate event was sent (wall clock). 507 // The last time a timeupdate event was sent (wall clock).
503 double m_lastTimeUpdateEventWallTime; 508 double m_lastTimeUpdateEventWallTime;
504 509
505 // The default playback start position. 510 // The default playback start position.
506 double m_defaultPlaybackStartPosition; 511 double m_defaultPlaybackStartPosition;
507 512
508 // Loading state. 513 // Loading state.
509 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem ent }; 514 enum LoadState { WaitingForSource, LoadingFromSrcObject, LoadingFromSrcAttr, LoadingFromSourceElement };
510 LoadState m_loadState; 515 LoadState m_loadState;
516 RawPtrWillBeMember<MediaProvider> m_srcObject;
511 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; 517 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode;
512 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; 518 RefPtrWillBeMember<Node> m_nextChildNodeToConsider;
513 519
514 // "Deferred loading" state (for preload=none). 520 // "Deferred loading" state (for preload=none).
515 enum DeferredLoadState { 521 enum DeferredLoadState {
516 // The load is not deferred. 522 // The load is not deferred.
517 NotDeferred, 523 NotDeferred,
518 // The load is deferred, and waiting for the task to set the 524 // The load is deferred, and waiting for the task to set the
519 // delaying-the-load-event flag (to false). 525 // delaying-the-load-event flag (to false).
520 WaitingForStopDelayingLoadEventTask, 526 WaitingForStopDelayingLoadEventTask,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 inline bool isHTMLMediaElement(const HTMLElement& element) 634 inline bool isHTMLMediaElement(const HTMLElement& element)
629 { 635 {
630 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 636 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
631 } 637 }
632 638
633 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 639 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
634 640
635 } // namespace blink 641 } // namespace blink
636 642
637 #endif // HTMLMediaElement_h 643 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698