diff options
Diffstat (limited to 'webkit/api')
-rw-r--r-- | webkit/api/public/WebMediaPlayer.h | 10 | ||||
-rw-r--r-- | webkit/api/src/WebMediaPlayerClientImpl.cpp | 28 | ||||
-rw-r--r-- | webkit/api/src/WebMediaPlayerClientImpl.h | 2 |
3 files changed, 40 insertions, 0 deletions
diff --git a/webkit/api/public/WebMediaPlayer.h b/webkit/api/public/WebMediaPlayer.h index 8b60c77..56bc967 100644 --- a/webkit/api/public/WebMediaPlayer.h +++ b/webkit/api/public/WebMediaPlayer.h @@ -59,6 +59,13 @@ namespace WebKit { HaveEnoughData, }; + enum MovieLoadType{ + Unknown, + Download, + StoredStream, + LiveStream, + }; + virtual ~WebMediaPlayer() {} virtual void load(const WebURL&) = 0; @@ -104,6 +111,9 @@ namespace WebKit { virtual unsigned long long bytesLoaded() const = 0; virtual unsigned long long totalBytes() const = 0; + + virtual bool hasSingleSecurityOrigin() const = 0; + virtual MovieLoadType movieLoadType() const = 0; }; } // namespace WebKit diff --git a/webkit/api/src/WebMediaPlayerClientImpl.cpp b/webkit/api/src/WebMediaPlayerClientImpl.cpp index d26bd16..884d45b 100644 --- a/webkit/api/src/WebMediaPlayerClientImpl.cpp +++ b/webkit/api/src/WebMediaPlayerClientImpl.cpp @@ -361,6 +361,34 @@ void WebMediaPlayerClientImpl::setAutobuffer(bool autoBuffer) m_webMediaPlayer->setAutoBuffer(autoBuffer); } +bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const +{ + if (m_webMediaPlayer.get()) + return m_webMediaPlayer->hasSingleSecurityOrigin(); + return false; +} + +MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const +{ + COMPILE_ASSERT( + int(WebMediaPlayer::Unknown) == int(MediaPlayer::Unknown), + Unknown); + COMPILE_ASSERT( + int(WebMediaPlayer::Download) == int(MediaPlayer::Download), + Download); + COMPILE_ASSERT( + int(WebMediaPlayer::StoredStream) == int(MediaPlayer::StoredStream), + StoredStream); + COMPILE_ASSERT( + int(WebMediaPlayer::LiveStream) == int(MediaPlayer::LiveStream), + LiveStream); + + if (m_webMediaPlayer.get()) + return static_cast<MediaPlayer::MovieLoadType>( + m_webMediaPlayer->movieLoadType()); + return MediaPlayer::Unknown; +} + MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* player) { WebMediaPlayerClientImpl* client = new WebMediaPlayerClientImpl(); diff --git a/webkit/api/src/WebMediaPlayerClientImpl.h b/webkit/api/src/WebMediaPlayerClientImpl.h index d758276..721073c 100644 --- a/webkit/api/src/WebMediaPlayerClientImpl.h +++ b/webkit/api/src/WebMediaPlayerClientImpl.h @@ -90,6 +90,8 @@ namespace WebKit { virtual unsigned bytesLoaded() const; virtual void setSize(const WebCore::IntSize&); virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); + virtual bool hasSingleSecurityOrigin() const; + virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; private: WebMediaPlayerClientImpl(); |