summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
commit49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch)
tree5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
parentb211c645d8ab690f713515dfdc84d80b11c27d2c (diff)
downloadqtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp47
1 files changed, 42 insertions, 5 deletions
diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index 44e51cd87..95186dd86 100644
--- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -19,10 +19,10 @@
#include "PlatformContextSkia.h"
#include "RenderView.h"
#include "TimeRanges.h"
-#include "VideoLayerChromium.h"
#include "WebAudioSourceProvider.h"
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
+#include "WebHelperPluginImpl.h"
#include "WebKit.h"
#include "WebMediaPlayer.h"
#include "WebViewImpl.h"
@@ -96,6 +96,8 @@ WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl()
if (m_webMediaPlayer)
m_webMediaPlayer->setStreamTextureClient(0);
#endif
+ if (m_helperPlugin)
+ closeHelperPlugin();
}
void WebMediaPlayerClientImpl::networkStateChanged()
@@ -265,6 +267,32 @@ void WebMediaPlayerClientImpl::keyNeeded(const WebString& keySystem, const WebSt
#endif
}
+WebPlugin* WebMediaPlayerClientImpl::createHelperPlugin(const WebString& pluginType, WebFrame* frame)
+{
+ ASSERT(!m_helperPlugin);
+ WebViewImpl* webView = static_cast<WebViewImpl*>(frame->view());
+ m_helperPlugin = webView->createHelperPlugin(pluginType);
+ if (!m_helperPlugin)
+ return 0;
+
+ WebPlugin* plugin = m_helperPlugin->getPlugin();
+ if (!plugin) {
+ // There is no need to keep the helper plugin around and the caller
+ // should not be expected to call close after a failure (null pointer).
+ closeHelperPlugin();
+ return 0;
+ }
+
+ return plugin;
+}
+
+void WebMediaPlayerClientImpl::closeHelperPlugin()
+{
+ ASSERT(m_helperPlugin);
+ m_helperPlugin->closeHelperPlugin();
+ m_helperPlugin = 0;
+}
+
void WebMediaPlayerClientImpl::disableAcceleratedCompositing()
{
m_supportsAcceleratedCompositing = false;
@@ -301,7 +329,9 @@ void WebMediaPlayerClientImpl::loadInternal()
// Make sure if we create/re-create the WebMediaPlayer that we update our wrapper.
m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider());
#endif
- m_webMediaPlayer->load(KURL(ParsedURLString, m_url));
+ m_webMediaPlayer->load(
+ KURL(ParsedURLString, m_url),
+ static_cast<WebMediaPlayer::CORSMode>(m_mediaPlayer->mediaPlayerClient()->mediaPlayerCORSMode()));
}
}
@@ -312,10 +342,10 @@ void WebMediaPlayerClientImpl::cancelLoad()
}
#if USE(ACCELERATED_COMPOSITING)
-PlatformLayer* WebMediaPlayerClientImpl::platformLayer() const
+LayerChromium* WebMediaPlayerClientImpl::platformLayer() const
{
ASSERT(m_supportsAcceleratedCompositing);
- return m_videoLayer.unwrap<VideoLayerChromium>();
+ return m_videoLayer.unwrap<LayerChromium>();
}
#endif
@@ -608,7 +638,7 @@ void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re
{
#if USE(ACCELERATED_COMPOSITING)
// If we are using GPU to render video, ignore requests to paint frames into
- // canvas because it will be taken care of by VideoLayerChromium.
+ // canvas because it will be taken care of by WebVideoLayer.
if (acceleratedRenderingInUse())
return;
#endif
@@ -645,6 +675,13 @@ bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const
return false;
}
+bool WebMediaPlayerClientImpl::didPassCORSAccessCheck() const
+{
+ if (m_webMediaPlayer)
+ return m_webMediaPlayer->didPassCORSAccessCheck();
+ return false;
+}
+
MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const
{
if (m_webMediaPlayer)