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

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: Created 4 years, 9 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void attach(const AttachContext& = AttachContext()) override; 273 void attach(const AttachContext& = AttachContext()) override;
274 274
275 void didMoveToNewDocument(Document& oldDocument) override; 275 void didMoveToNewDocument(Document& oldDocument) override;
276 virtual KURL posterImageURL() const { return KURL(); } 276 virtual KURL posterImageURL() const { return KURL(); }
277 277
278 enum DisplayMode { Unknown, Poster, Video }; 278 enum DisplayMode { Unknown, Poster, Video };
279 DisplayMode getDisplayMode() const { return m_displayMode; } 279 DisplayMode getDisplayMode() const { return m_displayMode; }
280 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } 280 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
281 281
282 private: 282 private:
283 class Task;
284
283 void resetMediaPlayerAndMediaSource(); 285 void resetMediaPlayerAndMediaSource();
284 286
285 bool alwaysCreateUserAgentShadowRoot() const final { return true; } 287 bool alwaysCreateUserAgentShadowRoot() const final { return true; }
286 bool areAuthorShadowsAllowed() const final { return false; } 288 bool areAuthorShadowsAllowed() const final { return false; }
287 289
288 bool supportsFocus() const final; 290 bool supportsFocus() const final;
289 bool isMouseFocusable() const final; 291 bool isMouseFocusable() const final;
290 bool layoutObjectIsNeeded(const ComputedStyle&) override; 292 bool layoutObjectIsNeeded(const ComputedStyle&) override;
291 LayoutObject* createLayoutObject(const ComputedStyle&) override; 293 LayoutObject* createLayoutObject(const ComputedStyle&) override;
292 InsertionNotificationRequest insertedInto(ContainerNode*) final; 294 InsertionNotificationRequest insertedInto(ContainerNode*) final;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 void seek(double time); 343 void seek(double time);
342 void finishSeek(); 344 void finishSeek();
343 void checkIfSeekNeeded(); 345 void checkIfSeekNeeded();
344 void addPlayedRange(double start, double end); 346 void addPlayedRange(double start, double end);
345 347
346 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity. 348 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity.
347 349
348 // loading 350 // loading
349 void invokeLoadAlgorithm(); 351 void invokeLoadAlgorithm();
350 void invokeResourceSelectionAlgorithm(); 352 void invokeResourceSelectionAlgorithm();
353 void continueResourceSelectionAlgorithm();
351 void loadInternal(); 354 void loadInternal();
352 void selectMediaResource(); 355 void selectMediaResource();
353 void loadResource(const KURL&, ContentType&); 356 void loadResource(const KURL&, ContentType&);
354 void startPlayerLoad(); 357 void startPlayerLoad();
355 void setPlayerPreload(); 358 void setPlayerPreload();
356 WebMediaPlayer::LoadType loadType() const; 359 WebMediaPlayer::LoadType loadType() const;
357 void scheduleNextSourceChild(); 360 void scheduleNextSourceChild();
358 void loadNextSourceChild(); 361 void loadNextSourceChild();
359 void clearMediaPlayer(); 362 void clearMediaPlayer();
360 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); 363 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 PersistentHeapVectorWillBeHeapVector<Member<ScriptPromiseResolver>> m_playRe solvers; 578 PersistentHeapVectorWillBeHeapVector<Member<ScriptPromiseResolver>> m_playRe solvers;
576 OwnPtr<CancellableTaskFactory> m_playPromiseResolveTask; 579 OwnPtr<CancellableTaskFactory> m_playPromiseResolveTask;
577 OwnPtr<CancellableTaskFactory> m_playPromiseRejectTask; 580 OwnPtr<CancellableTaskFactory> m_playPromiseRejectTask;
578 ExceptionCode m_playPromiseErrorCode; 581 ExceptionCode m_playPromiseErrorCode;
579 582
580 // This is a weak reference, since m_audioSourceNode holds a reference to us . 583 // This is a weak reference, since m_audioSourceNode holds a reference to us .
581 // FIXME: Oilpan: Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem. 584 // FIXME: Oilpan: Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem.
582 GC_PLUGIN_IGNORE("http://crbug.com/404577") 585 GC_PLUGIN_IGNORE("http://crbug.com/404577")
583 RawPtrWillBeWeakMember<AudioSourceProviderClient> m_audioSourceNode; 586 RawPtrWillBeWeakMember<AudioSourceProviderClient> m_audioSourceNode;
584 587
588 WeakPtr<Task> m_pendingTask; // owned by Microtask
589
585 // AudioClientImpl wraps an AudioSourceProviderClient. 590 // AudioClientImpl wraps an AudioSourceProviderClient.
586 // When the audio format is known, Chromium calls setFormat(). 591 // When the audio format is known, Chromium calls setFormat().
587 class AudioClientImpl final : public GarbageCollectedFinalized<AudioClientIm pl>, public WebAudioSourceProviderClient { 592 class AudioClientImpl final : public GarbageCollectedFinalized<AudioClientIm pl>, public WebAudioSourceProviderClient {
588 public: 593 public:
589 explicit AudioClientImpl(AudioSourceProviderClient* client) 594 explicit AudioClientImpl(AudioSourceProviderClient* client)
590 : m_client(client) 595 : m_client(client)
591 { 596 {
592 } 597 }
593 598
594 ~AudioClientImpl() override { } 599 ~AudioClientImpl() override { }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 inline bool isHTMLMediaElement(const HTMLElement& element) 649 inline bool isHTMLMediaElement(const HTMLElement& element)
645 { 650 {
646 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 651 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
647 } 652 }
648 653
649 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 654 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
650 655
651 } // namespace blink 656 } // namespace blink
652 657
653 #endif // HTMLMediaElement_h 658 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698