Skip to content
Permalink
Browse files
Windows: Implement 'preload=none'
https://bugs.webkit.org/show_bug.cgi?id=47317
<rdar://problem/7718442>

Reviewed by Eric Carlson.

WebCore:

Implement the 'preload=none' identically to the mac implementation. Add three new
ivars: m_preload, m_delayLoad and m_movieURL; and override the MediaPlayerPrivate
functions: prepareToPlay() and setPreload().

* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
    Initialize new ivars m_delayLoad and m_preload.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::resumeLoad): Added; new.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::load): Split contents between
    load and loadInternal.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::loadInternal): Added; new.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::prepareToPlay): Added; overrides MediaPlayerPrivate.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::setPreload): Added; overrides MediaPlayerPrivate.
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:

LayoutTests:

Do not skip the media/video-preload.html test on windows any longer.

* platform/win/Skipped:



Canonical link: https://commits.webkit.org/60646@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed Oct 19, 2010
1 parent 5eea1cb commit a8d9d3bc1103680a72ce3601b35f7a1a7999f355
Showing 5 changed files with 78 additions and 3 deletions.
@@ -1,3 +1,15 @@
2010-10-06 Jer Noble <jer.noble@apple.com>

Reviewed by Eric Carlson.

Windows: Implement 'preload=none'
https://bugs.webkit.org/show_bug.cgi?id=47317
<rdar://problem/7718442>

Do not skip the media/video-preload.html test on windows any longer.

* platform/win/Skipped:

2010-10-19 Zhenyao Mo <zmo@google.com>

Unreviewed, remove a passing webgl test from test_expectations.txt.
@@ -830,9 +830,6 @@ java
# Need to add functionality to DumpRenderTree to handle enable/disable Spatial Navigation
fast/events/spatial-navigation

# <rdar://problem/7718442> Implement 'preload=none'
media/video-preload.html

# For some reason crashes when run with all tests. Passes individually.
fast/forms/multiple-form-submission-protection-mouse.html

@@ -1,3 +1,26 @@
2010-10-06 Jer Noble <jer.noble@apple.com>

Reviewed by Eric Carlson.

Windows: Implement 'preload=none'
https://bugs.webkit.org/show_bug.cgi?id=47317
<rdar://problem/7718442>

Implement the 'preload=none' identically to the mac implementation. Add three new
ivars: m_preload, m_delayLoad and m_movieURL; and override the MediaPlayerPrivate
functions: prepareToPlay() and setPreload().

* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
Initialize new ivars m_delayLoad and m_preload.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::resumeLoad): Added; new.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::load): Split contents between
load and loadInternal.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::loadInternal): Added; new.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::prepareToPlay): Added; overrides MediaPlayerPrivate.
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::setPreload): Added; overrides MediaPlayerPrivate.
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:

2010-10-19 Enrica Casucci <enrica@apple.com>

Reviewed by Alexey Proskuryakov.
@@ -174,6 +174,8 @@ MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualConte
, m_movieTransform(CGAffineTransformIdentity)
#endif
, m_visualContextClient(new MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient(this))
, m_delayingLoad(false)
, m_preload(MediaPlayer::Auto)
{
}

@@ -316,7 +318,27 @@ static void disableComponentsOnce()
QTMovie::disableComponent(componentsToDisable[i]);
}

void MediaPlayerPrivateQuickTimeVisualContext::resumeLoad()
{
m_delayingLoad = false;

if (!m_movieURL.isEmpty())
loadInternal(m_movieURL);
}

void MediaPlayerPrivateQuickTimeVisualContext::load(const String& url)
{
m_movieURL = url;

if (m_preload == MediaPlayer::None) {
m_delayingLoad = true;
return;
}

loadInternal(url);
}

void MediaPlayerPrivateQuickTimeVisualContext::loadInternal(const String& url)
{
if (!QTMovie::initializeQuickTime()) {
// FIXME: is this the right error to return?
@@ -347,6 +369,12 @@ void MediaPlayerPrivateQuickTimeVisualContext::load(const String& url)
m_movie->setVolume(m_player->volume());
}

void MediaPlayerPrivateQuickTimeVisualContext::prepareToPlay()
{
if (!m_movie || m_delayingLoad)
resumeLoad();
}

void MediaPlayerPrivateQuickTimeVisualContext::play()
{
if (!m_movie)
@@ -1005,6 +1033,13 @@ bool MediaPlayerPrivateQuickTimeVisualContext::hasSingleSecurityOrigin() const
return true;
}

void MediaPlayerPrivateQuickTimeVisualContext::setPreload(MediaPlayer::Preload preload)
{
m_preload = preload;
if (m_delayingLoad && m_preload != MediaPlayer::None)
resumeLoad();
}

MediaPlayerPrivateQuickTimeVisualContext::MediaRenderingMode MediaPlayerPrivateQuickTimeVisualContext::currentRenderingMode() const
{
if (!m_movie)
@@ -74,9 +74,12 @@ class MediaPlayerPrivateQuickTimeVisualContext : public MediaPlayerPrivateInterf

void load(const String& url);
void cancelLoad();
void loadInternal(const String& url);
void resumeLoad();

void play();
void pause();
void prepareToPlay();

bool paused() const;
bool seeking() const;
@@ -111,6 +114,8 @@ class MediaPlayerPrivateQuickTimeVisualContext : public MediaPlayerPrivateInterf
bool hasClosedCaptions() const;
void setClosedCaptionsVisible(bool);

void setPreload(MediaPlayer::Preload);

void updateStates();
void doSeek();
void cancelSeek();
@@ -189,6 +194,9 @@ class MediaPlayerPrivateQuickTimeVisualContext : public MediaPlayerPrivateInterf
bool m_isStreaming;
bool m_visible;
bool m_newFrameAvailable;
bool m_delayingLoad;
String m_movieURL;
MediaPlayer::Preload m_preload;
#if DRAW_FRAME_RATE
double m_frameCountWhilePlaying;
double m_timeStartedPlaying;

0 comments on commit a8d9d3b

Please sign in to comment.