Commit ec6e27a8 authored by jer.noble@apple.com's avatar jer.noble@apple.com

2011-03-25 Jer Noble <jer.noble@apple.com>

        Reviewed by Eric Carlson.

        MediaPlayerPrivateQuickTimeVisualContext should use the Application Cache during load.
        https://bugs.webkit.org/show_bug.cgi?id=57047

        No new tests.

        When loading a URL, checkk osee if the Appplication Cache has a version of that URL
        stored; if so, use the local path to that cached media instead of the remote URL.

        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::loadInternal):
        * platform/graphics/win/QTMovie.cpp:
        (QTMovie::loadPath):
        * platform/graphics/win/QTMovie.h:

git-svn-id: svn://svn.chromium.org/blink/trunk@82014 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e1b3dff6
2011-03-25 Jer Noble <jer.noble@apple.com>
Reviewed by Eric Carlson.
MediaPlayerPrivateQuickTimeVisualContext should use the Application Cache during load.
https://bugs.webkit.org/show_bug.cgi?id=57047
No new tests.
When loading a URL, checkk osee if the Appplication Cache has a version of that URL
stored; if so, use the local path to that cached media instead of the remote URL.
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::loadInternal):
* platform/graphics/win/QTMovie.cpp:
(QTMovie::loadPath):
* platform/graphics/win/QTMovie.h:
2011-03-25 Dan Bernstein <mitz@apple.com> 2011-03-25 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler. Reviewed by Darin Adler.
...@@ -28,8 +28,11 @@ ...@@ -28,8 +28,11 @@
#if ENABLE(VIDEO) #if ENABLE(VIDEO)
#include "MediaPlayerPrivateQuickTimeVisualContext.h" #include "MediaPlayerPrivateQuickTimeVisualContext.h"
#include "ApplicationCacheHost.h"
#include "ApplicationCacheResource.h"
#include "Cookie.h" #include "Cookie.h"
#include "CookieJar.h" #include "CookieJar.h"
#include "DocumentLoader.h"
#include "Frame.h" #include "Frame.h"
#include "FrameView.h" #include "FrameView.h"
#include "GraphicsContext.h" #include "GraphicsContext.h"
...@@ -369,7 +372,16 @@ void MediaPlayerPrivateQuickTimeVisualContext::loadInternal(const String& url) ...@@ -369,7 +372,16 @@ void MediaPlayerPrivateQuickTimeVisualContext::loadInternal(const String& url)
setUpCookiesForQuickTime(url); setUpCookiesForQuickTime(url);
m_movie = adoptRef(new QTMovie(m_movieClient.get())); m_movie = adoptRef(new QTMovie(m_movieClient.get()));
m_movie->load(url.characters(), url.length(), m_player->preservesPitch());
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
Frame* frame = m_player->frameView() ? m_player->frameView()->frame() : 0;
ApplicationCacheHost* cacheHost = frame ? frame->loader()->documentLoader()->applicationCacheHost() : 0;
ApplicationCacheResource* resource = 0;
if (cacheHost && cacheHost->shouldLoadResourceFromApplicationCache(ResourceRequest(url), resource) && resource && !resource->path().isEmpty())
m_movie->load(resource->path().characters(), resource->path().length(), m_player->preservesPitch());
else
#endif
m_movie->load(url.characters(), url.length(), m_player->preservesPitch());
m_movie->setVolume(m_player->volume()); m_movie->setVolume(m_player->volume());
} }
......
...@@ -442,6 +442,17 @@ void QTMovie::getNaturalSize(int& width, int& height) ...@@ -442,6 +442,17 @@ void QTMovie::getNaturalSize(int& width, int& height)
height = (rect.bottom - rect.top) * m_private->m_heightScaleFactor; height = (rect.bottom - rect.top) * m_private->m_heightScaleFactor;
} }
void QTMovie::loadPath(const UChar* url, int len, bool preservesPitch)
{
CFStringRef urlStringRef = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(url), len);
CFURLRef cfURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, urlStringRef, kCFURLWindowsPathStyle, false);
load(cfURL, preservesPitch);
CFRelease(cfURL);
CFRelease(urlStringRef);
}
void QTMovie::load(const UChar* url, int len, bool preservesPitch) void QTMovie::load(const UChar* url, int len, bool preservesPitch)
{ {
CFStringRef urlStringRef = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(url), len); CFStringRef urlStringRef = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(url), len);
......
...@@ -70,6 +70,7 @@ public: ...@@ -70,6 +70,7 @@ public:
void addClient(QTMovieClient*); void addClient(QTMovieClient*);
void removeClient(QTMovieClient*); void removeClient(QTMovieClient*);
void loadPath(const UChar* url, int len, bool preservesPitch);
void load(const UChar* url, int len, bool preservesPitch); void load(const UChar* url, int len, bool preservesPitch);
void load(CFURLRef, bool preservesPitch); void load(CFURLRef, bool preservesPitch);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment