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

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

Issue 327553002: Transition networkState back to NETWORK_IDLE on fetch if preload=none (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: deferredLoad -> deferLoad. Created 6 years, 6 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 | Annotate | Revision Log
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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 void scheduleTimeupdateEvent(bool periodicEvent); 357 void scheduleTimeupdateEvent(bool periodicEvent);
358 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity. 358 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity.
359 359
360 // loading 360 // loading
361 void prepareForLoad(); 361 void prepareForLoad();
362 void loadInternal(); 362 void loadInternal();
363 void selectMediaResource(); 363 void selectMediaResource();
364 void loadResource(const KURL&, ContentType&, const String& keySystem); 364 void loadResource(const KURL&, ContentType&, const String& keySystem);
365 void startPlayerLoad(); 365 void startPlayerLoad();
366 void setPlayerPreload(); 366 void setPlayerPreload();
367 void startDelayedLoad();
368 blink::WebMediaPlayer::LoadType loadType() const; 367 blink::WebMediaPlayer::LoadType loadType() const;
369 void scheduleNextSourceChild(); 368 void scheduleNextSourceChild();
370 void loadNextSourceChild(); 369 void loadNextSourceChild();
371 void userCancelledLoad(); 370 void userCancelledLoad();
372 void clearMediaPlayer(int flags); 371 void clearMediaPlayer(int flags);
373 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); 372 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking();
374 bool havePotentialSourceChild(); 373 bool havePotentialSourceChild();
375 void noneSupported(); 374 void noneSupported();
376 void mediaEngineError(PassRefPtrWillBeRawPtr<MediaError>); 375 void mediaEngineError(PassRefPtrWillBeRawPtr<MediaError>);
377 void cancelPendingEventsAndCallbacks(); 376 void cancelPendingEventsAndCallbacks();
378 void waitForSourceChange(); 377 void waitForSourceChange();
379 void prepareToPlay(); 378 void prepareToPlay();
380 379
381 KURL selectNextSourceChild(ContentType*, String* keySystem, InvalidURLAction ); 380 KURL selectNextSourceChild(ContentType*, String* keySystem, InvalidURLAction );
382 381
383 void mediaLoadingFailed(MediaPlayer::NetworkState); 382 void mediaLoadingFailed(MediaPlayer::NetworkState);
384 383
384 // deferred loading (preload=none)
385 bool loadIsDeferred() const;
386 void deferLoad();
387 void cancelDeferredLoad();
388 void startDeferredLoad();
389 void executeDeferredLoad();
390 void deferredLoadTimerFired(Timer<HTMLMediaElement>*);
391
385 void updateActiveTextTrackCues(double); 392 void updateActiveTextTrackCues(double);
386 HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const; 393 HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const;
387 394
388 void markCaptionAndSubtitleTracksAsUnconfigured(); 395 void markCaptionAndSubtitleTracksAsUnconfigured();
389 396
390 // This does not check user gesture restrictions. 397 // This does not check user gesture restrictions.
391 void playInternal(); 398 void playInternal();
392 399
393 void allowVideoRendering(); 400 void allowVideoRendering();
394 401
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 461
455 // The last time a timeupdate event was sent in movie time. 462 // The last time a timeupdate event was sent in movie time.
456 double m_lastTimeUpdateEventMovieTime; 463 double m_lastTimeUpdateEventMovieTime;
457 464
458 // Loading state. 465 // Loading state.
459 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem ent }; 466 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem ent };
460 LoadState m_loadState; 467 LoadState m_loadState;
461 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; 468 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode;
462 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; 469 RefPtrWillBeMember<Node> m_nextChildNodeToConsider;
463 470
471 // "Deferred loading" state (for preload=none).
472 enum DeferredLoadState {
473 // The load is not deferred.
474 NotDeferred,
475 // The load is deferred, and waiting for the task to set the
476 // delaying-the-load-event flag (to false).
477 WaitingForStopDelayingLoadEventTask,
478 // The load is the deferred, and waiting for a triggering event.
479 WaitingForTrigger,
480 // The load is deferred, and waiting for the task to set the
481 // delaying-the-load-event flag, after which the load will be executed.
482 ExecuteOnStopDelayingLoadEventTask
483 };
484 DeferredLoadState m_deferredLoadState;
485 Timer<HTMLMediaElement> m_deferredLoadTimer;
486
464 OwnPtr<MediaPlayer> m_player; 487 OwnPtr<MediaPlayer> m_player;
465 blink::WebLayer* m_webLayer; 488 blink::WebLayer* m_webLayer;
466 489
467 MediaPlayer::Preload m_preload; 490 MediaPlayer::Preload m_preload;
468 491
469 DisplayMode m_displayMode; 492 DisplayMode m_displayMode;
470 493
471 RefPtr<HTMLMediaSource> m_mediaSource; 494 RefPtr<HTMLMediaSource> m_mediaSource;
472 495
473 mutable double m_cachedTime; 496 mutable double m_cachedTime;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 inline bool isHTMLMediaElement(const HTMLElement& element) 586 inline bool isHTMLMediaElement(const HTMLElement& element)
564 { 587 {
565 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 588 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
566 } 589 }
567 590
568 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 591 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
569 592
570 } //namespace 593 } //namespace
571 594
572 #endif 595 #endif
OLDNEW
« no previous file with comments | « LayoutTests/media/video-preload-none-no-stalled-event-expected.txt ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698