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

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

Issue 1810513002: Media element resource selection algorithm should "await a stable state" Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, microtask changes, layouttest updation Created 4 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 void addTextTrack(WebInbandTextTrack*) final; 347 void addTextTrack(WebInbandTextTrack*) final;
348 void removeTextTrack(WebInbandTextTrack*) final; 348 void removeTextTrack(WebInbandTextTrack*) final;
349 void mediaSourceOpened(WebMediaSource*) final; 349 void mediaSourceOpened(WebMediaSource*) final;
350 void requestSeek(double) final; 350 void requestSeek(double) final;
351 void remoteRouteAvailabilityChanged(bool) final; 351 void remoteRouteAvailabilityChanged(bool) final;
352 void connectedToRemoteDevice() final; 352 void connectedToRemoteDevice() final;
353 void disconnectedFromRemoteDevice() final; 353 void disconnectedFromRemoteDevice() final;
354 void cancelledRemotePlaybackRequest() final; 354 void cancelledRemotePlaybackRequest() final;
355 void requestReload(const WebURL&) final; 355 void requestReload(const WebURL&) final;
356 356
357 void loadTimerFired(TimerBase*); 357 void textTrackLoadTimerFired(TimerBase*);
358 void progressEventTimerFired(TimerBase*); 358 void progressEventTimerFired(TimerBase*);
359 void playbackProgressTimerFired(TimerBase*); 359 void playbackProgressTimerFired(TimerBase*);
360 void startPlaybackProgressTimer(); 360 void startPlaybackProgressTimer();
361 void startProgressEventTimer(); 361 void startProgressEventTimer();
362 void stopPeriodicTimers(); 362 void stopPeriodicTimers();
363 363
364 void seek(double time); 364 void seek(double time);
365 void finishSeek(); 365 void finishSeek();
366 void checkIfSeekNeeded(); 366 void checkIfSeekNeeded();
367 void addPlayedRange(double start, double end); 367 void addPlayedRange(double start, double end);
368 368
369 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity. 369 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity.
370 370
371 // loading 371 // loading
372 void invokeLoadAlgorithm(); 372 void invokeLoadAlgorithm();
373 void invokeResourceSelectionAlgorithm(); 373 void invokeResourceSelectionAlgorithm();
374 void continueResourceSelectionAlgorithm();
374 void loadInternal(); 375 void loadInternal();
375 void selectMediaResource(); 376 void selectMediaResource();
376 void loadResource(const WebMediaPlayerSource&, const ContentType&); 377 void loadResource(const WebMediaPlayerSource&, const ContentType&);
377 void startPlayerLoad(const KURL& playerProvidedUrl = KURL()); 378 void startPlayerLoad(const KURL& playerProvidedUrl = KURL());
378 void setPlayerPreload(); 379 void setPlayerPreload();
379 WebMediaPlayer::LoadType loadType() const; 380 WebMediaPlayer::LoadType loadType() const;
380 void scheduleNextSourceChild(); 381 void scheduleNextSourceChild();
381 void loadSourceFromObject(); 382 void loadSourceFromObject();
382 void loadSourceFromAttribute(); 383 void loadSourceFromAttribute();
383 void loadNextSourceChild(); 384 void loadNextSourceChild();
385 void loadNextSourceChildAfterError();
384 void clearMediaPlayer(); 386 void clearMediaPlayer();
385 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); 387 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
386 bool havePotentialSourceChild(); 388 bool havePotentialSourceChild();
387 void noneSupported(); 389 void noneSupported();
388 void mediaEngineError(MediaError*); 390 void mediaEngineError(MediaError*);
389 void cancelPendingEventsAndCallbacks(); 391 void cancelPendingEventsAndCallbacks();
390 void waitForSourceChange(); 392 void waitForSourceChange();
391 void setIgnorePreloadNone(); 393 void setIgnorePreloadNone();
392 394
393 KURL selectNextSourceChild(ContentType*, InvalidURLAction); 395 KURL selectNextSourceChild(ContentType*, InvalidURLAction);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 void scheduleNotifyPlaying(); 492 void scheduleNotifyPlaying();
491 void resolveScheduledPlayPromises(); 493 void resolveScheduledPlayPromises();
492 void rejectScheduledPlayPromises(); 494 void rejectScheduledPlayPromises();
493 void rejectPlayPromises(ExceptionCode, const String&); 495 void rejectPlayPromises(ExceptionCode, const String&);
494 void rejectPlayPromisesInternal(ExceptionCode, const String&); 496 void rejectPlayPromisesInternal(ExceptionCode, const String&);
495 497
496 EnumerationHistogram& showControlsHistogram() const; 498 EnumerationHistogram& showControlsHistogram() const;
497 499
498 void onVisibilityChangedForAutoplay(bool isVisible); 500 void onVisibilityChangedForAutoplay(bool isVisible);
499 501
500 UnthrottledThreadTimer<HTMLMediaElement> m_loadTimer; 502 UnthrottledThreadTimer<HTMLMediaElement> m_textTrackLoadTimer;
501 UnthrottledThreadTimer<HTMLMediaElement> m_progressEventTimer; 503 UnthrottledThreadTimer<HTMLMediaElement> m_progressEventTimer;
502 UnthrottledThreadTimer<HTMLMediaElement> m_playbackProgressTimer; 504 UnthrottledThreadTimer<HTMLMediaElement> m_playbackProgressTimer;
503 UnthrottledThreadTimer<HTMLMediaElement> m_audioTracksTimer; 505 UnthrottledThreadTimer<HTMLMediaElement> m_audioTracksTimer;
504 Member<TimeRanges> m_playedTimeRanges; 506 Member<TimeRanges> m_playedTimeRanges;
505 Member<GenericEventQueue> m_asyncEventQueue; 507 Member<GenericEventQueue> m_asyncEventQueue;
506 508
507 double m_playbackRate; 509 double m_playbackRate;
508 double m_defaultPlaybackRate; 510 double m_defaultPlaybackRate;
509 NetworkState m_networkState; 511 NetworkState m_networkState;
510 ReadyState m_readyState; 512 ReadyState m_readyState;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 DisplayMode m_displayMode; 561 DisplayMode m_displayMode;
560 562
561 Member<HTMLMediaSource> m_mediaSource; 563 Member<HTMLMediaSource> m_mediaSource;
562 564
563 // Cached time value. Only valid when ready state is kHaveMetadata or 565 // Cached time value. Only valid when ready state is kHaveMetadata or
564 // higher, otherwise the current time is assumed to be zero. 566 // higher, otherwise the current time is assumed to be zero.
565 mutable double m_cachedTime; 567 mutable double m_cachedTime;
566 568
567 double m_fragmentEndTime; 569 double m_fragmentEndTime;
568 570
569 typedef unsigned PendingActionFlags;
570 PendingActionFlags m_pendingActionFlags;
571
572 // FIXME: HTMLMediaElement has way too many state bits. 571 // FIXME: HTMLMediaElement has way too many state bits.
573 bool m_lockedPendingUserGesture : 1; 572 bool m_lockedPendingUserGesture : 1;
574 bool m_playing : 1; 573 bool m_playing : 1;
575 bool m_shouldDelayLoadEvent : 1; 574 bool m_shouldDelayLoadEvent : 1;
576 bool m_haveFiredLoadedData : 1; 575 bool m_haveFiredLoadedData : 1;
577 bool m_autoplaying : 1; 576 bool m_autoplaying : 1;
578 bool m_muted : 1; 577 bool m_muted : 1;
579 bool m_paused : 1; 578 bool m_paused : 1;
580 bool m_seeking : 1; 579 bool m_seeking : 1;
581 580
(...skipping 19 matching lines...) Expand all
601 600
602 Member<CueTimeline> m_cueTimeline; 601 Member<CueTimeline> m_cueTimeline;
603 602
604 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; 603 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers;
605 std::unique_ptr<CancellableTaskFactory> m_playPromiseResolveTask; 604 std::unique_ptr<CancellableTaskFactory> m_playPromiseResolveTask;
606 std::unique_ptr<CancellableTaskFactory> m_playPromiseRejectTask; 605 std::unique_ptr<CancellableTaskFactory> m_playPromiseRejectTask;
607 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolveList; 606 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolveList;
608 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseRejectList; 607 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseRejectList;
609 ExceptionCode m_playPromiseErrorCode; 608 ExceptionCode m_playPromiseErrorCode;
610 609
610 WeakPtrFactory<HTMLMediaElement> m_weakTaskFactory;
611
611 // This is a weak reference, since m_audioSourceNode holds a reference to us . 612 // This is a weak reference, since m_audioSourceNode holds a reference to us .
612 // TODO(Oilpan): Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem. 613 // TODO(Oilpan): Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem.
613 GC_PLUGIN_IGNORE("http://crbug.com/404577") 614 GC_PLUGIN_IGNORE("http://crbug.com/404577")
614 WeakMember<AudioSourceProviderClient> m_audioSourceNode; 615 WeakMember<AudioSourceProviderClient> m_audioSourceNode;
615 616
616 // AudioClientImpl wraps an AudioSourceProviderClient. 617 // AudioClientImpl wraps an AudioSourceProviderClient.
617 // When the audio format is known, Chromium calls setFormat(). 618 // When the audio format is known, Chromium calls setFormat().
618 class AudioClientImpl final : public GarbageCollectedFinalized<AudioClientIm pl>, public WebAudioSourceProviderClient { 619 class AudioClientImpl final : public GarbageCollectedFinalized<AudioClientIm pl>, public WebAudioSourceProviderClient {
619 public: 620 public:
620 explicit AudioClientImpl(AudioSourceProviderClient* client) 621 explicit AudioClientImpl(AudioSourceProviderClient* client)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 inline bool isHTMLMediaElement(const HTMLElement& element) 686 inline bool isHTMLMediaElement(const HTMLElement& element)
686 { 687 {
687 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 688 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
688 } 689 }
689 690
690 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 691 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
691 692
692 } // namespace blink 693 } // namespace blink
693 694
694 #endif // HTMLMediaElement_h 695 #endif // HTMLMediaElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/media/video-source.html ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698