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

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

Issue 2384273007: reflow comments in core/html/*.{cpp,h},core/html/imports (Closed)
Patch Set: comments Created 4 years, 2 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
3 * reserved.
3 * 4 *
4 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
6 * are met: 7 * are met:
7 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
12 * 13 *
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 ExceptionState&); 210 ExceptionState&);
210 211
211 TextTrackList* textTracks(); 212 TextTrackList* textTracks();
212 CueTimeline& cueTimeline(); 213 CueTimeline& cueTimeline();
213 214
214 void addTextTrack(TextTrack*); 215 void addTextTrack(TextTrack*);
215 void removeTextTrack(TextTrack*); 216 void removeTextTrack(TextTrack*);
216 void textTracksChanged(); 217 void textTracksChanged();
217 void notifyMediaPlayerOfTextTrackChanges(); 218 void notifyMediaPlayerOfTextTrackChanges();
218 219
219 // Implements the "forget the media element's media-resource-specific tracks" algorithm in the HTML5 spec. 220 // Implements the "forget the media element's media-resource-specific tracks"
221 // algorithm in the HTML5 spec.
220 void forgetResourceSpecificTracks(); 222 void forgetResourceSpecificTracks();
221 223
222 void didAddTrackElement(HTMLTrackElement*); 224 void didAddTrackElement(HTMLTrackElement*);
223 void didRemoveTrackElement(HTMLTrackElement*); 225 void didRemoveTrackElement(HTMLTrackElement*);
224 226
225 void honorUserPreferencesForAutomaticTextTrackSelection(); 227 void honorUserPreferencesForAutomaticTextTrackSelection();
226 228
227 bool textTracksAreReady() const; 229 bool textTracksAreReady() const;
228 void configureTextTrackDisplay(); 230 void configureTextTrackDisplay();
229 void updateTextTrackDisplay(); 231 void updateTextTrackDisplay();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // Checks to see if current media data is CORS-same-origin as the 284 // Checks to see if current media data is CORS-same-origin as the
283 // specified origin. 285 // specified origin.
284 bool isMediaDataCORSSameOrigin(SecurityOrigin*) const; 286 bool isMediaDataCORSSameOrigin(SecurityOrigin*) const;
285 287
286 void scheduleEvent(Event*); 288 void scheduleEvent(Event*);
287 void scheduleTimeupdateEvent(bool periodicEvent); 289 void scheduleTimeupdateEvent(bool periodicEvent);
288 290
289 // Returns the "effective media volume" value as specified in the HTML5 spec. 291 // Returns the "effective media volume" value as specified in the HTML5 spec.
290 double effectiveMediaVolume() const; 292 double effectiveMediaVolume() const;
291 293
292 // Predicates also used when dispatching wrapper creation (cf. [SpecialWrapFor ] IDL attribute usage.) 294 // Predicates also used when dispatching wrapper creation (cf.
295 // [SpecialWrapFor] IDL attribute usage.)
293 virtual bool isHTMLAudioElement() const { return false; } 296 virtual bool isHTMLAudioElement() const { return false; }
294 virtual bool isHTMLVideoElement() const { return false; } 297 virtual bool isHTMLVideoElement() const { return false; }
295 298
296 // Temporary callback for crbug.com/487345,402044 299 // Temporary callback for crbug.com/487345,402044
297 void notifyPositionMayHaveChanged(const IntRect&); 300 void notifyPositionMayHaveChanged(const IntRect&);
298 void updatePositionNotificationRegistration(); 301 void updatePositionNotificationRegistration();
299 302
300 WebRemotePlaybackClient* remotePlaybackClient() { 303 WebRemotePlaybackClient* remotePlaybackClient() {
301 return m_remotePlaybackClient; 304 return m_remotePlaybackClient;
302 } 305 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 void playbackProgressTimerFired(TimerBase*); 393 void playbackProgressTimerFired(TimerBase*);
391 void startPlaybackProgressTimer(); 394 void startPlaybackProgressTimer();
392 void startProgressEventTimer(); 395 void startProgressEventTimer();
393 void stopPeriodicTimers(); 396 void stopPeriodicTimers();
394 397
395 void seek(double time); 398 void seek(double time);
396 void finishSeek(); 399 void finishSeek();
397 void checkIfSeekNeeded(); 400 void checkIfSeekNeeded();
398 void addPlayedRange(double start, double end); 401 void addPlayedRange(double start, double end);
399 402
400 void scheduleEvent( 403 // FIXME: Rename to scheduleNamedEvent for clarity.
401 const AtomicString& 404 void scheduleEvent(const AtomicString& eventName);
402 eventName); // FIXME: Rename to scheduleNamedEvent for clarity.
403 405
404 // loading 406 // loading
405 void invokeLoadAlgorithm(); 407 void invokeLoadAlgorithm();
406 void invokeResourceSelectionAlgorithm(); 408 void invokeResourceSelectionAlgorithm();
407 void loadInternal(); 409 void loadInternal();
408 void selectMediaResource(); 410 void selectMediaResource();
409 void loadResource(const WebMediaPlayerSource&, const ContentType&); 411 void loadResource(const WebMediaPlayerSource&, const ContentType&);
410 void startPlayerLoad(const KURL& playerProvidedUrl = KURL()); 412 void startPlayerLoad(const KURL& playerProvidedUrl = KURL());
411 void setPlayerPreload(); 413 void setPlayerPreload();
412 WebMediaPlayer::LoadType loadType() const; 414 WebMediaPlayer::LoadType loadType() const;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 void pauseInternal(); 446 void pauseInternal();
445 447
446 void allowVideoRendering(); 448 void allowVideoRendering();
447 449
448 void updateVolume(); 450 void updateVolume();
449 void updatePlayState(); 451 void updatePlayState();
450 bool potentiallyPlaying() const; 452 bool potentiallyPlaying() const;
451 bool stoppedDueToErrors() const; 453 bool stoppedDueToErrors() const;
452 bool couldPlayIfEnoughData() const; 454 bool couldPlayIfEnoughData() const;
453 455
454 // Generally the presence of the loop attribute should be considered to mean p layback 456 // Generally the presence of the loop attribute should be considered to mean
455 // has not "ended", as "ended" and "looping" are mutually exclusive. See 457 // playback has not "ended", as "ended" and "looping" are mutually exclusive.
458 // See
456 // https://html.spec.whatwg.org/multipage/embedded-content.html#ended-playback 459 // https://html.spec.whatwg.org/multipage/embedded-content.html#ended-playback
457 enum class LoopCondition { Included, Ignored }; 460 enum class LoopCondition { Included, Ignored };
458 bool endedPlayback(LoopCondition = LoopCondition::Included) const; 461 bool endedPlayback(LoopCondition = LoopCondition::Included) const;
459 462
460 void setShouldDelayLoadEvent(bool); 463 void setShouldDelayLoadEvent(bool);
461 void invalidateCachedTime(); 464 void invalidateCachedTime();
462 void refreshCachedTime() const; 465 void refreshCachedTime() const;
463 466
464 void ensureMediaControls(); 467 void ensureMediaControls();
465 void configureMediaControls(); 468 void configureMediaControls();
466 469
467 TextTrackContainer& ensureTextTrackContainer(); 470 TextTrackContainer& ensureTextTrackContainer();
468 471
469 EventDispatchHandlingState* preDispatchEventHandler(Event*) final; 472 EventDispatchHandlingState* preDispatchEventHandler(Event*) final;
470 473
471 void changeNetworkStateFromLoadingToIdle(); 474 void changeNetworkStateFromLoadingToIdle();
472 475
473 bool isAutoplaying() const { return m_autoplaying; } 476 bool isAutoplaying() const { return m_autoplaying; }
474 477
475 void setAllowHiddenVolumeControls(bool); 478 void setAllowHiddenVolumeControls(bool);
476 479
477 WebMediaPlayer::CORSMode corsMode() const; 480 WebMediaPlayer::CORSMode corsMode() const;
478 481
479 // Returns the "direction of playback" value as specified in the HTML5 spec. 482 // Returns the "direction of playback" value as specified in the HTML5 spec.
480 enum DirectionOfPlayback { Backward, Forward }; 483 enum DirectionOfPlayback { Backward, Forward };
481 DirectionOfPlayback getDirectionOfPlayback() const; 484 DirectionOfPlayback getDirectionOfPlayback() const;
482 485
483 // Creates placeholder AudioTrack and/or VideoTrack objects when WebMemediaPla yer objects 486 // Creates placeholder AudioTrack and/or VideoTrack objects when
484 // advertise they have audio and/or video, but don't explicitly signal them vi a 487 // WebMemediaPlayer objects advertise they have audio and/or video, but don't
485 // addAudioTrack() and addVideoTrack(). 488 // explicitly signal them via addAudioTrack() and addVideoTrack().
486 // FIXME: Remove this once all WebMediaPlayer implementations properly report their track info. 489 // FIXME: Remove this once all WebMediaPlayer implementations properly report
490 // their track info.
487 void createPlaceholderTracksIfNecessary(); 491 void createPlaceholderTracksIfNecessary();
488 492
489 // Sets the selected/enabled tracks if they aren't set before we initially 493 // Sets the selected/enabled tracks if they aren't set before we initially
490 // transition to kHaveMetadata. 494 // transition to kHaveMetadata.
491 void selectInitialTracksIfNecessary(); 495 void selectInitialTracksIfNecessary();
492 496
493 // Return true if and only if a user gesture is required to unlock this 497 // Return true if and only if a user gesture is required to unlock this
494 // media element for unrestricted autoplay / script control. Don't confuse 498 // media element for unrestricted autoplay / script control. Don't confuse
495 // this with isGestureNeededForPlayback(). The latter is usually what one 499 // this with isGestureNeededForPlayback(). The latter is usually what one
496 // should use, if checking to see if an action is allowed. 500 // should use, if checking to see if an action is allowed.
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 Member<CueTimeline> m_cueTimeline; 644 Member<CueTimeline> m_cueTimeline;
641 645
642 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; 646 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers;
643 std::unique_ptr<CancellableTaskFactory> m_playPromiseResolveTask; 647 std::unique_ptr<CancellableTaskFactory> m_playPromiseResolveTask;
644 std::unique_ptr<CancellableTaskFactory> m_playPromiseRejectTask; 648 std::unique_ptr<CancellableTaskFactory> m_playPromiseRejectTask;
645 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolveList; 649 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolveList;
646 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseRejectList; 650 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseRejectList;
647 ExceptionCode m_playPromiseErrorCode; 651 ExceptionCode m_playPromiseErrorCode;
648 652
649 // This is a weak reference, since m_audioSourceNode holds a reference to us. 653 // This is a weak reference, since m_audioSourceNode holds a reference to us.
650 // TODO(Oilpan): Consider making this a strongly traced pointer with oilpan wh ere strong cycles are not a problem. 654 // TODO(Oilpan): Consider making this a strongly traced pointer with oilpan
655 // where strong cycles are not a problem.
651 GC_PLUGIN_IGNORE("http://crbug.com/404577") 656 GC_PLUGIN_IGNORE("http://crbug.com/404577")
652 WeakMember<AudioSourceProviderClient> m_audioSourceNode; 657 WeakMember<AudioSourceProviderClient> m_audioSourceNode;
653 658
654 // AudioClientImpl wraps an AudioSourceProviderClient. 659 // AudioClientImpl wraps an AudioSourceProviderClient.
655 // When the audio format is known, Chromium calls setFormat(). 660 // When the audio format is known, Chromium calls setFormat().
656 class AudioClientImpl final 661 class AudioClientImpl final
657 : public GarbageCollectedFinalized<AudioClientImpl>, 662 : public GarbageCollectedFinalized<AudioClientImpl>,
658 public WebAudioSourceProviderClient { 663 public WebAudioSourceProviderClient {
659 public: 664 public:
660 explicit AudioClientImpl(AudioSourceProviderClient* client) 665 explicit AudioClientImpl(AudioSourceProviderClient* client)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 725
721 inline bool isHTMLMediaElement(const HTMLElement& element) { 726 inline bool isHTMLMediaElement(const HTMLElement& element) {
722 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 727 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
723 } 728 }
724 729
725 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 730 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
726 731
727 } // namespace blink 732 } // namespace blink
728 733
729 #endif // HTMLMediaElement_h 734 #endif // HTMLMediaElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMapElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698