diff options
22 files changed, 1574 insertions, 1841 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 273327f..8b390f4 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1754,8 +1754,8 @@ 'renderer/user_script_slave.h', 'renderer/visitedlink_slave.cc', 'renderer/visitedlink_slave.h', - 'renderer/webmediaplayer_delegate_impl.cc', - 'renderer/webmediaplayer_delegate_impl.h', + 'renderer/webmediaplayer_impl.cc', + 'renderer/webmediaplayer_impl.h', 'renderer/webplugin_delegate_proxy.cc', 'renderer/webplugin_delegate_proxy.h', 'renderer/webworker_proxy.cc', diff --git a/chrome/renderer/media/buffered_data_source.cc b/chrome/renderer/media/buffered_data_source.cc index f6daf58..67d3b9d 100644 --- a/chrome/renderer/media/buffered_data_source.cc +++ b/chrome/renderer/media/buffered_data_source.cc @@ -9,7 +9,6 @@ #include "chrome/common/extensions/url_pattern.h" #include "chrome/renderer/media/buffered_data_source.h" #include "chrome/renderer/render_view.h" -#include "chrome/renderer/webmediaplayer_delegate_impl.h" #include "chrome/renderer/render_thread.h" #include "media/base/filter_host.h" #include "net/base/load_flags.h" @@ -36,7 +35,7 @@ bool IsSchemeSupported(const GURL& url) { ///////////////////////////////////////////////////////////////////////////// // BufferedResourceLoader -BufferedResourceLoader::BufferedResourceLoader(int route_id, +BufferedResourceLoader::BufferedResourceLoader(int32 routing_id, const GURL& url, int64 first_byte_position, int64 last_byte_position) @@ -52,7 +51,7 @@ BufferedResourceLoader::BufferedResourceLoader(int route_id, completed_(false), range_requested_(false), async_start_(false), - route_id_(route_id), + routing_id_(routing_id), url_(url), first_byte_position_(first_byte_position), last_byte_position_(last_byte_position), @@ -109,7 +108,7 @@ int BufferedResourceLoader::Start(net::CompletionCallback* start_callback) { // app_cache_context()->context_id() // For now don't service media resource requests from the appcache. WebAppCacheContext::kNoAppCacheContextId, - route_id_)); + routing_id_)); // We may receive stop signal while we are inside this method, it's because // Start() may get called on demuxer thread while Stop() is called on @@ -458,8 +457,8 @@ void BufferedResourceLoader::InvokeAndResetStartCallback(int error) { ////////////////////////////////////////////////////////////////////////////// // BufferedDataSource -BufferedDataSource::BufferedDataSource(WebMediaPlayerDelegateImpl* delegate) - : delegate_(delegate), +BufferedDataSource::BufferedDataSource(int routing_id) + : routing_id_(routing_id), stopped_(false), position_(0), total_bytes_(kPositionNotSpecified), @@ -505,8 +504,7 @@ bool BufferedDataSource::Initialize(const std::string& url) { AutoLock auto_lock(lock_); if (!stopped_) { buffered_resource_loader_ = new BufferedResourceLoader( - delegate_->view()->routing_id(), - url_, kPositionNotSpecified, kPositionNotSpecified); + routing_id_, url_, kPositionNotSpecified, kPositionNotSpecified); resource_loader = buffered_resource_loader_; } } @@ -564,8 +562,7 @@ size_t BufferedDataSource::Read(uint8* data, size_t size) { // Create a new resource loader. resource_loader = - new BufferedResourceLoader(delegate_->view()->routing_id(), - url_, position_, + new BufferedResourceLoader(routing_id_, url_, position_, kPositionNotSpecified); buffered_resource_loader_ = resource_loader; } diff --git a/chrome/renderer/media/buffered_data_source.h b/chrome/renderer/media/buffered_data_source.h index bd80402..cc1a0bb 100644 --- a/chrome/renderer/media/buffered_data_source.h +++ b/chrome/renderer/media/buffered_data_source.h @@ -20,8 +20,6 @@ #include "webkit/glue/resource_loader_bridge.h" #include "googleurl/src/gurl.h" -class WebMediaPlayerDelegateImpl; - ///////////////////////////////////////////////////////////////////////////// // BufferedResourceLoader // This class works inside demuxer thread and render thread. It contains a @@ -32,7 +30,7 @@ class BufferedResourceLoader : public base::RefCountedThreadSafe<BufferedResourceLoader>, public webkit_glue::ResourceLoaderBridge::Peer { public: - BufferedResourceLoader(int route_id, + BufferedResourceLoader(int32 routing_id, const GURL& url, int64 first_byte_position, int64 last_byte_position); @@ -139,7 +137,7 @@ class BufferedResourceLoader : bool range_requested_; bool async_start_; - int route_id_; + int32 routing_id_; GURL url_; int64 first_byte_position_; int64 last_byte_position_; @@ -161,10 +159,8 @@ class BufferedDataSource : public media::DataSource { public: // Methods called from pipeline thread // Static methods for creating this class. - static media::FilterFactory* CreateFactory( - WebMediaPlayerDelegateImpl* delegate) { - return new media::FilterFactoryImpl1<BufferedDataSource, - WebMediaPlayerDelegateImpl*>(delegate); + static media::FilterFactory* CreateFactory(int32 routing_id) { + return new media::FilterFactoryImpl1<BufferedDataSource, int32>(routing_id); } virtual bool Initialize(const std::string& url); @@ -182,8 +178,7 @@ class BufferedDataSource : public media::DataSource { const media::MediaFormat& media_format(); private: - friend class media::FilterFactoryImpl1<BufferedDataSource, - WebMediaPlayerDelegateImpl*>; + friend class media::FilterFactoryImpl1<BufferedDataSource, int32>; // Call to filter host to trigger an error, be sure not to call this method // while the lock is acquired. void HandleError(media::PipelineError error); @@ -194,17 +189,13 @@ class BufferedDataSource : public media::DataSource { void InitialRequestStarted(int error); void OnInitialRequestStarted(int error); - explicit BufferedDataSource(WebMediaPlayerDelegateImpl* delegate); + explicit BufferedDataSource(int32 routing_id); virtual ~BufferedDataSource(); media::MediaFormat media_format_; GURL url_; - // Pointer to the delegate which provides access to RenderView, this is set - // in construction and can be accessed in all threads safely. - // TODO(hclam): get rid of this and save the routing id and pointer to - // ResourceDispatcher. - WebMediaPlayerDelegateImpl* delegate_; + int32 routing_id_; // A common lock for protecting members accessed by multiple threads. Lock lock_; diff --git a/chrome/renderer/media/simple_data_source.cc b/chrome/renderer/media/simple_data_source.cc index cb625e2..b1644b7 100644 --- a/chrome/renderer/media/simple_data_source.cc +++ b/chrome/renderer/media/simple_data_source.cc @@ -6,7 +6,6 @@ #include "chrome/renderer/media/simple_data_source.h" #include "chrome/renderer/render_thread.h" #include "chrome/renderer/render_view.h" -#include "chrome/renderer/webmediaplayer_delegate_impl.h" #include "media/base/filter_host.h" #include "net/base/load_flags.h" #include "net/http/http_response_headers.h" diff --git a/chrome/renderer/media/video_renderer_impl.cc b/chrome/renderer/media/video_renderer_impl.cc index ed1704f..be3466c 100644 --- a/chrome/renderer/media/video_renderer_impl.cc +++ b/chrome/renderer/media/video_renderer_impl.cc @@ -5,7 +5,7 @@ #include "chrome/renderer/media/video_renderer_impl.h" #include "media/base/yuv_convert.h" -VideoRendererImpl::VideoRendererImpl(WebMediaPlayerDelegateImpl* delegate) +VideoRendererImpl::VideoRendererImpl(WebMediaPlayerImpl* delegate) : delegate_(delegate), last_converted_frame_(NULL) { // TODO(hclam): decide whether to do the following line in this thread or diff --git a/chrome/renderer/media/video_renderer_impl.h b/chrome/renderer/media/video_renderer_impl.h index 01ded10..9a39933 100644 --- a/chrome/renderer/media/video_renderer_impl.h +++ b/chrome/renderer/media/video_renderer_impl.h @@ -17,12 +17,12 @@ #include "base/gfx/platform_canvas.h" #include "base/gfx/rect.h" #include "base/gfx/size.h" -#include "chrome/renderer/webmediaplayer_delegate_impl.h" +#include "chrome/renderer/webmediaplayer_impl.h" #include "media/base/buffers.h" #include "media/base/factory.h" #include "media/base/filters.h" #include "media/filters/video_renderer_base.h" -#include "webkit/glue/webmediaplayer_delegate.h" +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayer.h" class VideoRendererImpl : public media::VideoRendererBase { public: @@ -39,10 +39,9 @@ class VideoRendererImpl : public media::VideoRendererBase { virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); // Static method for creating factory for this object. - static media::FilterFactory* CreateFactory( - WebMediaPlayerDelegateImpl* delegate) { - return new media::FilterFactoryImpl1< - VideoRendererImpl, WebMediaPlayerDelegateImpl*>(delegate); + static media::FilterFactory* CreateFactory(WebMediaPlayerImpl* delegate) { + return new media::FilterFactoryImpl1<VideoRendererImpl, + WebMediaPlayerImpl*>(delegate); } private: @@ -56,11 +55,11 @@ class VideoRendererImpl : public media::VideoRendererBase { virtual void OnPaintNeeded(); friend class media::FilterFactoryImpl1<VideoRendererImpl, - WebMediaPlayerDelegateImpl*>; + WebMediaPlayerImpl*>; // Constructor and destructor are private. Only the filter factory is // allowed to create instances. - explicit VideoRendererImpl(WebMediaPlayerDelegateImpl* delegate); + explicit VideoRendererImpl(WebMediaPlayerImpl* delegate); virtual ~VideoRendererImpl() {} // Internal method used by the Paint method to convert the specified video @@ -68,7 +67,7 @@ class VideoRendererImpl : public media::VideoRendererBase { void CopyToCurrentFrame(media::VideoFrame* video_frame); // Pointer to our parent object that is called to request repaints. - WebMediaPlayerDelegateImpl* delegate_; + WebMediaPlayerImpl* delegate_; // An RGB bitmap used to convert the video frames. SkBitmap bitmap_; diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 03df749..4db143d 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -39,7 +39,7 @@ #include "chrome/renderer/renderer_logging.h" #include "chrome/renderer/user_script_slave.h" #include "chrome/renderer/visitedlink_slave.h" -#include "chrome/renderer/webmediaplayer_delegate_impl.h" +#include "chrome/renderer/webmediaplayer_impl.h" #include "chrome/renderer/webplugin_delegate_proxy.h" #include "chrome/renderer/webworker_proxy.h" #include "grit/generated_resources.h" @@ -1872,11 +1872,12 @@ WebPluginDelegate* RenderView::CreatePluginDelegate( #endif } -webkit_glue::WebMediaPlayerDelegate* RenderView::CreateMediaPlayerDelegate() { +WebKit::WebMediaPlayer* RenderView::CreateWebMediaPlayer( + WebKit::WebMediaPlayerClient* client) { #if defined(OS_WIN) - return new WebMediaPlayerDelegateImpl(this); + return new WebMediaPlayerImpl(this, client); #else - // TODO(port) + // TODO(port): media player is not functional other than on Windows. NOTIMPLEMENTED(); return NULL; #endif diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index bdd415c..17abcc2 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -74,6 +74,8 @@ struct FileUploadData; namespace WebKit { class WebDragData; struct WebFindOptions; +class WebMediaPlayer; +class WebMediaPlayerClient; } // We need to prevent a page from trying to create infinite popups. It is not @@ -244,7 +246,8 @@ class RenderView : public RenderWidget, const std::string& clsid, std::string* actual_mime_type); virtual WebKit::WebWorker* CreateWebWorker(WebKit::WebWorkerClient* client); - virtual webkit_glue::WebMediaPlayerDelegate* CreateMediaPlayerDelegate(); + virtual WebKit::WebMediaPlayer* CreateWebMediaPlayer( + WebKit::WebMediaPlayerClient* client); virtual void OnMissingPluginStatus(WebPluginDelegate* delegate, int status); virtual void OpenURL(WebView* webview, const GURL& url, const GURL& referrer, diff --git a/chrome/renderer/renderer.vcproj b/chrome/renderer/renderer.vcproj index bd1f995..b86fae6 100644 --- a/chrome/renderer/renderer.vcproj +++ b/chrome/renderer/renderer.vcproj @@ -153,14 +153,6 @@ > </File> <File - RelativePath=".\media\data_source_impl.cc" - > - </File> - <File - RelativePath=".\media\data_source_impl.h" - > - </File> - <File RelativePath=".\media\simple_data_source.cc" > </File> @@ -438,11 +430,11 @@ > </File> <File - RelativePath=".\webmediaplayer_delegate_impl.cc" + RelativePath=".\webmediaplayer_impl.cc" > </File> <File - RelativePath=".\webmediaplayer_delegate_impl.h" + RelativePath=".\webmediaplayer_impl.h" > </File> <File diff --git a/chrome/renderer/webmediaplayer_delegate_impl.cc b/chrome/renderer/webmediaplayer_impl.cc index 00e65ab..6966479 100644 --- a/chrome/renderer/webmediaplayer_delegate_impl.cc +++ b/chrome/renderer/webmediaplayer_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/renderer/webmediaplayer_delegate_impl.h" +#include "chrome/renderer/webmediaplayer_impl.h" #include "base/command_line.h" #include "chrome/common/chrome_switches.h" @@ -22,6 +22,7 @@ #include "media/filters/null_audio_renderer.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" +#include "third_party/WebKit/WebKit/chromium/public/WebURL.h" using WebKit::WebRect; using WebKit::WebSize; @@ -31,39 +32,40 @@ using WebKit::WebSize; class NotifyWebMediaPlayerTask : public CancelableTask { public: - NotifyWebMediaPlayerTask(WebMediaPlayerDelegateImpl* delegate, - WebMediaPlayerMethod method) - : delegate_(delegate), + NotifyWebMediaPlayerTask(WebMediaPlayerImpl* media_player, + WebMediaPlayerClientMethod method) + : media_player_(media_player), method_(method) {} virtual void Run() { - if (delegate_) { - (delegate_->web_media_player()->*(method_))(); - delegate_->DidTask(this); + if (media_player_) { + (media_player_->client()->*(method_))(); + media_player_->DidTask(this); } } virtual void Cancel() { - delegate_ = NULL; + media_player_ = NULL; } private: - WebMediaPlayerDelegateImpl* delegate_; - WebMediaPlayerMethod method_; + WebMediaPlayerImpl* media_player_; + WebMediaPlayerClientMethod method_; DISALLOW_COPY_AND_ASSIGN(NotifyWebMediaPlayerTask); }; ///////////////////////////////////////////////////////////////////////////// -// WebMediaPlayerDelegateImpl implementation +// WebMediaPlayerImpl implementation -WebMediaPlayerDelegateImpl::WebMediaPlayerDelegateImpl(RenderView* view) - : network_state_(webkit_glue::WebMediaPlayer::EMPTY), - ready_state_(webkit_glue::WebMediaPlayer::HAVE_NOTHING), +WebMediaPlayerImpl::WebMediaPlayerImpl(RenderView* view, + WebKit::WebMediaPlayerClient* client) + : network_state_(WebKit::WebMediaPlayer::Empty), + ready_state_(WebKit::WebMediaPlayer::HaveNothing), main_loop_(NULL), filter_factory_(new media::FilterFactoryCollection()), video_renderer_(NULL), - web_media_player_(NULL), + client_(client), view_(view), tasks_(kLastTaskIndex) { // Add in any custom filter factories first. @@ -87,57 +89,48 @@ WebMediaPlayerDelegateImpl::WebMediaPlayerDelegateImpl(RenderView* view) // Add in the default filter factories. filter_factory_->AddFactory( AudioRendererImpl::CreateFactory(view_->audio_message_filter())); - filter_factory_->AddFactory(BufferedDataSource::CreateFactory(this)); + filter_factory_->AddFactory( + BufferedDataSource::CreateFactory(view->routing_id())); filter_factory_->AddFactory(VideoRendererImpl::CreateFactory(this)); + + DCHECK(client_); + + // Saves the current message loop. + DCHECK(!main_loop_); + main_loop_ = MessageLoop::current(); + + // Also we want to be notified of |main_loop_| destruction. + main_loop_->AddDestructionObserver(this); } -WebMediaPlayerDelegateImpl::~WebMediaPlayerDelegateImpl() { +WebMediaPlayerImpl::~WebMediaPlayerImpl() { pipeline_.Stop(); - // Cancel all tasks posted on the main_loop_. + // Cancel all tasks posted on the |main_loop_|. CancelAllTasks(); - // After cancelling all tasks, we are sure there will be no calls to - // web_media_player_, so we are safe to delete it. - if (web_media_player_) { - delete web_media_player_; - } - - // Finally tell the main_loop_ we don't want to be notified of destruction + // Finally tell the |main_loop_| we don't want to be notified of destruction // event. if (main_loop_) { main_loop_->RemoveDestructionObserver(this); } } -void WebMediaPlayerDelegateImpl::Initialize( - webkit_glue::WebMediaPlayer* media_player) { - DCHECK(!web_media_player_); - web_media_player_ = media_player; - - // Saves the current message loop. - DCHECK(!main_loop_); - main_loop_ = MessageLoop::current(); - - // Also we want to be notified of main_loop_ destruction. - main_loop_->AddDestructionObserver(this); -} - -void WebMediaPlayerDelegateImpl::Load(const GURL& url) { +void WebMediaPlayerImpl::load(const WebKit::WebURL& url) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // Initialize the pipeline pipeline_.Start(filter_factory_.get(), url.spec(), - NewCallback(this, &WebMediaPlayerDelegateImpl::DidInitializePipeline)); + NewCallback(this, &WebMediaPlayerImpl::DidInitializePipeline)); } -void WebMediaPlayerDelegateImpl::CancelLoad() { +void WebMediaPlayerImpl::cancelLoad() { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // TODO(hclam): Calls to render_view_ to stop resource load } -void WebMediaPlayerDelegateImpl::Play() { +void WebMediaPlayerImpl::play() { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // TODO(hclam): We should restore the previous playback rate rather than @@ -145,20 +138,20 @@ void WebMediaPlayerDelegateImpl::Play() { pipeline_.SetPlaybackRate(1.0f); } -void WebMediaPlayerDelegateImpl::Pause() { +void WebMediaPlayerImpl::pause() { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); pipeline_.SetPlaybackRate(0.0f); } -void WebMediaPlayerDelegateImpl::Stop() { +void WebMediaPlayerImpl::stop() { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // We can fire Stop() multiple times. pipeline_.Stop(); } -void WebMediaPlayerDelegateImpl::Seek(float seconds) { +void WebMediaPlayerImpl::seek(float seconds) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); pipeline_.Seek(base::TimeDelta::FromSeconds(static_cast<int64>(seconds))); @@ -168,116 +161,101 @@ void WebMediaPlayerDelegateImpl::Seek(float seconds) { // // TODO(scherkus): add a seek completion callback to the pipeline. PostTask(kTimeChangedTaskIndex, - &webkit_glue::WebMediaPlayer::NotifyTimeChange); + &WebKit::WebMediaPlayerClient::timeChanged); } -void WebMediaPlayerDelegateImpl::SetEndTime(float seconds) { +void WebMediaPlayerImpl::setEndTime(float seconds) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // TODO(hclam): add method call when it has been implemented. return; } -void WebMediaPlayerDelegateImpl::SetPlaybackRate(float rate) { +void WebMediaPlayerImpl::setRate(float rate) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); pipeline_.SetPlaybackRate(rate); } -void WebMediaPlayerDelegateImpl::SetVolume(float volume) { +void WebMediaPlayerImpl::setVolume(float volume) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); pipeline_.SetVolume(volume); } -void WebMediaPlayerDelegateImpl::SetVisible(bool visible) { +void WebMediaPlayerImpl::setVisible(bool visible) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // TODO(hclam): add appropriate method call when pipeline has it implemented. return; } -bool WebMediaPlayerDelegateImpl::IsTotalBytesKnown() { +bool WebMediaPlayerImpl::setAutoBuffer(bool autoBuffer) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); - return pipeline_.GetTotalBytes() != 0; + return false; } -bool WebMediaPlayerDelegateImpl::IsVideo() const { +bool WebMediaPlayerImpl::totalBytesKnown() { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); - size_t width, height; - pipeline_.GetVideoSize(&width, &height); - return width != 0 && height != 0; + return pipeline_.GetTotalBytes() != 0; } -size_t WebMediaPlayerDelegateImpl::GetWidth() const { +bool WebMediaPlayerImpl::hasVideo() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); size_t width, height; pipeline_.GetVideoSize(&width, &height); - return width; + return width != 0 && height != 0; } -size_t WebMediaPlayerDelegateImpl::GetHeight() const { +WebKit::WebSize WebMediaPlayerImpl::naturalSize() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); size_t width, height; pipeline_.GetVideoSize(&width, &height); - return height; + return WebKit::WebSize(width, height); } -bool WebMediaPlayerDelegateImpl::IsPaused() const { +bool WebMediaPlayerImpl::paused() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); return pipeline_.GetPlaybackRate() == 0.0f; } -bool WebMediaPlayerDelegateImpl::IsSeeking() const { +bool WebMediaPlayerImpl::seeking() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); return tasks_[kTimeChangedTaskIndex] != NULL; } -float WebMediaPlayerDelegateImpl::GetDuration() const { +float WebMediaPlayerImpl::duration() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); return static_cast<float>(pipeline_.GetDuration().InSecondsF()); } -float WebMediaPlayerDelegateImpl::GetCurrentTime() const { +float WebMediaPlayerImpl::currentTime() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); return static_cast<float>(pipeline_.GetTime().InSecondsF()); } - -float WebMediaPlayerDelegateImpl::GetPlayBackRate() const { - DCHECK(main_loop_ && MessageLoop::current() == main_loop_); - - return pipeline_.GetPlaybackRate(); -} - -float WebMediaPlayerDelegateImpl::GetVolume() const { - DCHECK(main_loop_ && MessageLoop::current() == main_loop_); - - return pipeline_.GetVolume(); -} - -int WebMediaPlayerDelegateImpl::GetDataRate() const { +int WebMediaPlayerImpl::dataRate() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // TODO(hclam): Add this method call if pipeline has it in the interface. return 0; } -float WebMediaPlayerDelegateImpl::GetMaxTimeBuffered() const { +float WebMediaPlayerImpl::maxTimeBuffered() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); return static_cast<float>(pipeline_.GetBufferedTime().InSecondsF()); } -float WebMediaPlayerDelegateImpl::GetMaxTimeSeekable() const { +float WebMediaPlayerImpl::maxTimeSeekable() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); // TODO(scherkus): move this logic down into the pipeline. @@ -290,19 +268,19 @@ float WebMediaPlayerDelegateImpl::GetMaxTimeSeekable() const { return static_cast<float>(duration * (buffered_bytes / total_bytes)); } -int64 WebMediaPlayerDelegateImpl::GetBytesLoaded() const { +unsigned long long WebMediaPlayerImpl::bytesLoaded() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); return pipeline_.GetBufferedBytes(); } -int64 WebMediaPlayerDelegateImpl::GetTotalBytes() const { +unsigned long long WebMediaPlayerImpl::totalBytes() const { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); return pipeline_.GetTotalBytes(); } -void WebMediaPlayerDelegateImpl::SetSize(const WebSize& size) { +void WebMediaPlayerImpl::setSize(const WebSize& size) { DCHECK(main_loop_ && MessageLoop::current() == main_loop_); if (video_renderer_) { @@ -311,42 +289,43 @@ void WebMediaPlayerDelegateImpl::SetSize(const WebSize& size) { } } -void WebMediaPlayerDelegateImpl::Paint(skia::PlatformCanvas *canvas, - const WebRect& rect) { +void WebMediaPlayerImpl::paint(skia::PlatformCanvas* canvas, + const WebRect& rect) { + DCHECK(main_loop_ && MessageLoop::current() == main_loop_); + if (video_renderer_) { video_renderer_->Paint(canvas, rect); } } -void WebMediaPlayerDelegateImpl::WillDestroyCurrentMessageLoop() { +void WebMediaPlayerImpl::WillDestroyCurrentMessageLoop() { pipeline_.Stop(); } -void WebMediaPlayerDelegateImpl::DidInitializePipeline(bool successful) { +void WebMediaPlayerImpl::DidInitializePipeline(bool successful) { if (successful) { - // Since we have initialized the pipeline, we should be able to play it. - // And we skip LOADED_METADATA state and starting with LOADED_FIRST_FRAME. - ready_state_ = webkit_glue::WebMediaPlayer::HAVE_ENOUGH_DATA; - network_state_ = webkit_glue::WebMediaPlayer::LOADED; + // Since we have initialized the pipeline, say we have everything. + // TODO(hclam): change this to report the correct status. + ready_state_ = WebKit::WebMediaPlayer::HaveEnoughData; + network_state_ = WebKit::WebMediaPlayer::Loaded; } else { // TODO(hclam): should use pipeline_.GetError() to determine the state // properly and reports error using MediaError. - ready_state_ = webkit_glue::WebMediaPlayer::HAVE_NOTHING; - network_state_ = webkit_glue::WebMediaPlayer::NETWORK_ERROR; + ready_state_ = WebKit::WebMediaPlayer::HaveNothing; + network_state_ = WebKit::WebMediaPlayer::NetworkError; } PostTask(kNetworkStateTaskIndex, - &webkit_glue::WebMediaPlayer::NotifyNetworkStateChange); + &WebKit::WebMediaPlayerClient::networkStateChanged); PostTask(kReadyStateTaskIndex, - &webkit_glue::WebMediaPlayer::NotifyReadyStateChange); + &WebKit::WebMediaPlayerClient::readyStateChanged); } -void WebMediaPlayerDelegateImpl::SetVideoRenderer( - VideoRendererImpl* video_renderer) { +void WebMediaPlayerImpl::SetVideoRenderer(VideoRendererImpl* video_renderer) { video_renderer_ = video_renderer; } -void WebMediaPlayerDelegateImpl::DidTask(CancelableTask* task) { +void WebMediaPlayerImpl::DidTask(CancelableTask* task) { AutoLock auto_lock(task_lock_); for (size_t i = 0; i < tasks_.size(); ++i) { @@ -358,7 +337,7 @@ void WebMediaPlayerDelegateImpl::DidTask(CancelableTask* task) { NOTREACHED(); } -void WebMediaPlayerDelegateImpl::CancelAllTasks() { +void WebMediaPlayerImpl::CancelAllTasks() { AutoLock auto_lock(task_lock_); // Loop through the list of tasks and cancel tasks that are still alive. for (size_t i = 0; i < tasks_.size(); ++i) { @@ -367,18 +346,18 @@ void WebMediaPlayerDelegateImpl::CancelAllTasks() { } } -void WebMediaPlayerDelegateImpl::PostTask(int index, - WebMediaPlayerMethod method) { +void WebMediaPlayerImpl::PostTask(int index, + WebMediaPlayerClientMethod method) { DCHECK(main_loop_); AutoLock auto_lock(task_lock_); - if(!tasks_[index]) { + if (!tasks_[index]) { CancelableTask* task = new NotifyWebMediaPlayerTask(this, method); tasks_[index] = task; main_loop_->PostTask(FROM_HERE, task); } } -void WebMediaPlayerDelegateImpl::PostRepaintTask() { - PostTask(kRepaintTaskIndex, &webkit_glue::WebMediaPlayer::Repaint); +void WebMediaPlayerImpl::PostRepaintTask() { + PostTask(kRepaintTaskIndex, &WebKit::WebMediaPlayerClient::repaint); } diff --git a/chrome/renderer/webmediaplayer_delegate_impl.h b/chrome/renderer/webmediaplayer_impl.h index 9ae5383..12c675f 100644 --- a/chrome/renderer/webmediaplayer_delegate_impl.h +++ b/chrome/renderer/webmediaplayer_impl.h @@ -1,8 +1,8 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be found +// in the LICENSE file. // -// Delegate calls from WebCore::MediaPlayerPrivate to google's video player. +// Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. // It contains PipelineImpl which is the actual media player pipeline, it glues // the media player pipeline, data source, audio renderer and renderer. // PipelineImpl would creates multiple threads and access some public methods @@ -40,19 +40,22 @@ // at destruction of this class we will need to unhook it from destruction event // list of the main thread. -#ifndef CHROME_RENDERER_WEBMEDIAPLAYER_DELEGATE_IMPL_H_ -#define CHROME_RENDERER_WEBMEDIAPLAYER_DELEGATE_IMPL_H_ +#ifndef CHROME_RENDERER_WEBMEDIAPLAYER_IMPL_H_ +#define CHROME_RENDERER_WEBMEDIAPLAYER_IMPL_H_ #include <vector> +#include "base/gfx/platform_canvas.h" #include "base/lock.h" #include "base/message_loop.h" #include "media/base/filters.h" #include "media/base/pipeline_impl.h" -#include "webkit/glue/webmediaplayer_delegate.h" +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayer.h" +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerClient.h" class AudioRendererImpl; class DataSourceImpl; +class GURL; class RenderView; class VideoRendererImpl; @@ -60,103 +63,97 @@ namespace media { class FilterFactoryCollection; } -// This typedef is used for WebMediaPlayerDelegateImpl::PostTask() and +// This typedef is used for WebMediaPlayerImpl::PostTask() and // NotifyWebMediaPlayerTask in the source file. -typedef void (webkit_glue::WebMediaPlayer::*WebMediaPlayerMethod)(); +typedef void (WebKit::WebMediaPlayerClient::*WebMediaPlayerClientMethod)(); -class WebMediaPlayerDelegateImpl : public webkit_glue::WebMediaPlayerDelegate, - public MessageLoop::DestructionObserver { +class WebMediaPlayerImpl : public WebKit::WebMediaPlayer, + public MessageLoop::DestructionObserver { public: - explicit WebMediaPlayerDelegateImpl(RenderView* view); - virtual ~WebMediaPlayerDelegateImpl(); + WebMediaPlayerImpl(RenderView* view, WebKit::WebMediaPlayerClient* client); + virtual ~WebMediaPlayerImpl(); - // Implementations of WebMediaPlayerDelegate, theses following methods are - // called from the WebKit, essentially lives inside the main thread. - virtual void Initialize(webkit_glue::WebMediaPlayer* media_player); - - virtual void Load(const GURL& url); - virtual void CancelLoad(); + virtual void load(const WebKit::WebURL& url); + virtual void cancelLoad(); // Playback controls. - virtual void Play(); - virtual void Pause(); - virtual void Stop(); - virtual void Seek(float seconds); - virtual void SetEndTime(float seconds); - virtual void SetPlaybackRate(float rate); - virtual void SetVolume(float volume); - virtual void SetVisible(bool visible); - virtual bool IsTotalBytesKnown(); + virtual void play(); + virtual void pause(); + virtual void stop(); + virtual void seek(float seconds); + virtual void setEndTime(float seconds); + virtual void setRate(float rate); + virtual void setVolume(float volume); + virtual void setVisible(bool visible); + virtual bool setAutoBuffer(bool autoBuffer); + virtual bool totalBytesKnown(); + virtual float maxTimeBuffered() const; + virtual float maxTimeSeekable() const; // Methods for painting. - virtual void SetSize(const WebKit::WebSize& size); + virtual void setSize(const WebKit::WebSize& size); - virtual void Paint(skia::PlatformCanvas *canvas, - const WebKit::WebRect& rect); + virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect); // True if a video is loaded. - virtual bool IsVideo() const; + virtual bool hasVideo() const; - // Dimension of the video. - virtual size_t GetWidth() const; - virtual size_t GetHeight() const; + // Dimensions of the video. + virtual WebKit::WebSize naturalSize() const; // Getters of playback state. - virtual bool IsPaused() const; - virtual bool IsSeeking() const; - virtual float GetDuration() const; - virtual float GetCurrentTime() const; - virtual float GetPlayBackRate() const; - virtual float GetVolume() const; - virtual float GetMaxTimeBuffered() const; - virtual float GetMaxTimeSeekable() const; + virtual bool paused() const; + virtual bool seeking() const; + virtual float duration() const; + virtual float currentTime() const; // Get rate of loading the resource. - virtual int32 GetDataRate() const; + virtual int32 dataRate() const; // Internal states of loading and network. // TODO(hclam): Ask the pipeline about the state rather than having reading // them from members which would cause race conditions. - virtual webkit_glue::WebMediaPlayer::NetworkState GetNetworkState() const { + virtual WebKit::WebMediaPlayer::NetworkState networkState() const { return network_state_; } - virtual webkit_glue::WebMediaPlayer::ReadyState GetReadyState() const { + virtual WebKit::WebMediaPlayer::ReadyState readyState() const { return ready_state_; } - virtual int64 GetBytesLoaded() const; - virtual int64 GetTotalBytes() const; + virtual unsigned long long bytesLoaded() const; + virtual unsigned long long totalBytes() const; - // As we are closing the tab or even the browser, main_loop_ is destroyed + // As we are closing the tab or even the browser, |main_loop_| is destroyed // even before this object gets destructed, so we need to know when - // main_loop_ is being destroyed and we can stop posting repaint task + // |main_loop_| is being destroyed and we can stop posting repaint task // to it. virtual void WillDestroyCurrentMessageLoop(); - // Callbacks. + // Notification callback for initialization from |pipeline_|. |successful| is + // true if the pipeline initialization is successful otherwise false. void DidInitializePipeline(bool successful); - // Called from tasks posted to main_loop_ from this object to remove + // Called from tasks posted to |main_loop_| from this object to remove // reference of them. void DidTask(CancelableTask* task); // Public methods to be called from renderers and data source so that - // WebMediaPlayerDelegateImpl has references to them. + // WebMediaPlayerImpl has references to them. void SetVideoRenderer(VideoRendererImpl* video_renderer); - // Called from VideoRenderer to fire a repaint task to main_loop_. + // Called from VideoRenderer to fire a repaint task to |main_loop_|. void PostRepaintTask(); // Inline getters. - webkit_glue::WebMediaPlayer* web_media_player() { return web_media_player_; } + WebKit::WebMediaPlayerClient* client() { return client_; } RenderView* view() { return view_; } private: // Methods for posting tasks and cancelling tasks. This method may lives in // the main thread or the media threads. - void PostTask(int index, WebMediaPlayerMethod method); + void PostTask(int index, WebMediaPlayerClientMethod method); - // Cancel all tasks currently lives in |main_loop_|. + // Cancel all tasks currently live in |main_loop_|. void CancelAllTasks(); // Indexes for tasks. @@ -169,12 +166,12 @@ class WebMediaPlayerDelegateImpl : public webkit_glue::WebMediaPlayerDelegate, }; // TODO(hclam): get rid of these members and read from the pipeline directly. - webkit_glue::WebMediaPlayer::NetworkState network_state_; - webkit_glue::WebMediaPlayer::ReadyState ready_state_; + WebKit::WebMediaPlayer::NetworkState network_state_; + WebKit::WebMediaPlayer::ReadyState ready_state_; // Message loops for posting tasks between Chrome's main thread. Also used // for DCHECKs so methods calls won't execute in the wrong thread. - MessageLoop* main_loop_; + MessageLoop* |main_loop_|; // A collection of factories for creating filters. scoped_refptr<media::FilterFactoryCollection> filter_factory_; @@ -187,7 +184,7 @@ class WebMediaPlayerDelegateImpl : public webkit_glue::WebMediaPlayerDelegate, // from WebKit. scoped_refptr<VideoRendererImpl> video_renderer_; - webkit_glue::WebMediaPlayer* web_media_player_; + WebKit::WebMediaPlayerClient* client_; RenderView* view_; // List of tasks for holding pointers to all tasks currently in the @@ -197,7 +194,7 @@ class WebMediaPlayerDelegateImpl : public webkit_glue::WebMediaPlayerDelegate, typedef std::vector<CancelableTask*> CancelableTaskList; CancelableTaskList tasks_; - DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerDelegateImpl); + DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); }; -#endif // ifndef CHROME_RENDERER_WEBMEDIAPLAYER_DELEGATE_IMPL_H_ +#endif // CHROME_RENDERER_WEBMEDIAPLAYER_IMPL_H_ diff --git a/webkit/build/WebKit/WebKit.vcproj b/webkit/build/WebKit/WebKit.vcproj index b9eb133..2805c99 100644 --- a/webkit/build/WebKit/WebKit.vcproj +++ b/webkit/build/WebKit/WebKit.vcproj @@ -184,6 +184,14 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebMediaPlayer.h" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebMediaPlayerClient.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebPluginListBuilder.h" > </File> diff --git a/webkit/glue/glue.vcproj b/webkit/glue/glue.vcproj index 0677fbb..cb20e01 100644 --- a/webkit/glue/glue.vcproj +++ b/webkit/glue/glue.vcproj @@ -1,972 +1,964 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Glue"
- ProjectGUID="{C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09}"
- RootNamespace="glue"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- <ToolFile
- RelativePath=".\devtools\devtools_copy.rules"
- />
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="4"
- InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\glue.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="devtools file copy"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="4"
- InheritedPropertySheets="..\..\build\release.vsprops;.\glue.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="devtools file copy"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="API"
- >
- <File
- RelativePath=".\autofill_form.cc"
- >
- </File>
- <File
- RelativePath=".\autofill_form.h"
- >
- </File>
- <File
- RelativePath=".\context_menu.h"
- >
- </File>
- <File
- RelativePath=".\cpp_bound_class.h"
- >
- </File>
- <File
- RelativePath=".\cpp_variant.h"
- >
- </File>
- <File
- RelativePath=".\dom_operations.h"
- >
- </File>
- <File
- RelativePath=".\form_data.h"
- >
- </File>
- <File
- RelativePath=".\image_decoder.h"
- >
- </File>
- <File
- RelativePath=".\password_form.h"
- >
- </File>
- <File
- RelativePath=".\resource_type.h"
- >
- </File>
- <File
- RelativePath=".\screen_info.h"
- >
- </File>
- <File
- RelativePath=".\webaccessibility.h"
- >
- </File>
- <File
- RelativePath=".\webaccessibilitymanager.h"
- >
- </File>
- <File
- RelativePath=".\webappcachecontext.cc"
- >
- </File>
- <File
- RelativePath=".\webappcachecontext.h"
- >
- </File>
- <File
- RelativePath=".\webdatasource.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient_delegate.h"
- >
- </File>
- <File
- RelativePath=".\weberror.h"
- >
- </File>
- <File
- RelativePath=".\webframe.h"
- >
- </File>
- <File
- RelativePath=".\webhistoryitem.h"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer.h"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webplugin.h"
- >
- </File>
- <File
- RelativePath=".\webplugin_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webplugininfo.h"
- >
- </File>
- <File
- RelativePath=".\webpreferences.h"
- >
- </File>
- <File
- RelativePath=".\webresponse.h"
- >
- </File>
- <File
- RelativePath=".\webtextinput.h"
- >
- </File>
- <File
- RelativePath=".\weburlrequest.h"
- >
- </File>
- <File
- RelativePath=".\webview.h"
- >
- </File>
- <File
- RelativePath=".\webview_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webwidget.h"
- >
- </File>
- <File
- RelativePath=".\webwidget_delegate.h"
- >
- </File>
- <File
- RelativePath=".\webworker.h"
- >
- </File>
- <File
- RelativePath=".\webworkerclient.h"
- >
- </File>
- <File
- RelativePath=".\window_open_disposition.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Library"
- >
- <File
- RelativePath=".\alt_404_page_resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\alt_404_page_resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\alt_error_page_resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\alt_error_page_resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\back_forward_list_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\back_forward_list_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\chrome_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\chrome_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\chromium_bridge_impl.cc"
- >
- </File>
- <File
- RelativePath=".\context_menu_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\context_menu_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\cpp_binding_example.cc"
- >
- </File>
- <File
- RelativePath=".\cpp_bound_class.cc"
- >
- </File>
- <File
- RelativePath=".\cpp_variant.cc"
- >
- </File>
- <File
- RelativePath=".\debugger_bridge.cc"
- >
- </File>
- <File
- RelativePath=".\debugger_bridge.h"
- >
- </File>
- <File
- RelativePath=".\dom_operations.cc"
- >
- </File>
- <File
- RelativePath=".\dom_operations_private.h"
- >
- </File>
- <File
- RelativePath=".\dom_serializer.cc"
- >
- </File>
- <File
- RelativePath=".\dom_serializer.h"
- >
- </File>
- <File
- RelativePath=".\dom_serializer_delegate.h"
- >
- </File>
- <File
- RelativePath=".\dragclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\dragclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\editor_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\editor_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\entity_map.cc"
- >
- </File>
- <File
- RelativePath=".\entity_map.h"
- >
- </File>
- <File
- RelativePath=".\event_conversion.cc"
- >
- </File>
- <File
- RelativePath=".\event_conversion.h"
- >
- </File>
- <File
- RelativePath=".\feed_preview.cc"
- >
- </File>
- <File
- RelativePath=".\feed_preview.h"
- >
- </File>
- <File
- RelativePath=".\glue_accessibility_object.cc"
- >
- </File>
- <File
- RelativePath=".\glue_accessibility_object.h"
- >
- </File>
- <File
- RelativePath=".\glue_serialize.cc"
- >
- </File>
- <File
- RelativePath=".\glue_serialize.h"
- >
- </File>
- <File
- RelativePath=".\glue_util.cc"
- >
- </File>
- <File
- RelativePath=".\glue_util.h"
- >
- </File>
- <File
- RelativePath=".\image_decoder.cc"
- >
- </File>
- <File
- RelativePath=".\image_resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\image_resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\inspector_client_impl.cc"
- >
- </File>
- <File
- RelativePath=".\inspector_client_impl.h"
- >
- </File>
- <File
- RelativePath=".\localized_strings.cc"
- >
- </File>
- <File
- RelativePath=".\media_player_private_impl.cc"
- >
- </File>
- <File
- RelativePath=".\multipart_response_delegate.cc"
- >
- </File>
- <File
- RelativePath=".\multipart_response_delegate.h"
- >
- </File>
- <File
- RelativePath=".\npruntime_util.cc"
- >
- </File>
- <File
- RelativePath=".\npruntime_util.h"
- >
- </File>
- <File
- RelativePath=".\password_autocomplete_listener.cc"
- >
- </File>
- <File
- RelativePath=".\password_autocomplete_listener.h"
- >
- </File>
- <File
- RelativePath=".\password_form_dom_manager.cc"
- >
- </File>
- <File
- RelativePath=".\password_form_dom_manager.h"
- >
- </File>
- <File
- RelativePath=".\resource.h"
- >
- </File>
- <File
- RelativePath=".\resource_fetcher.cc"
- >
- </File>
- <File
- RelativePath=".\resource_fetcher.h"
- >
- </File>
- <File
- RelativePath=".\resource_handle_impl.cc"
- >
- </File>
- <File
- RelativePath=".\resource_loader_bridge.cc"
- >
- </File>
- <File
- RelativePath=".\resource_loader_bridge.h"
- >
- </File>
- <File
- RelativePath=".\scoped_clipboard_writer_glue.h"
- >
- </File>
- <File
- RelativePath=".\searchable_form_data.cc"
- >
- </File>
- <File
- RelativePath=".\searchable_form_data.h"
- >
- </File>
- <File
- RelativePath=".\simple_webmimeregistry_impl.cc"
- >
- </File>
- <File
- RelativePath=".\simple_webmimeregistry_impl.h"
- >
- </File>
- <File
- RelativePath=".\stacking_order_iterator.cc"
- >
- </File>
- <File
- RelativePath=".\stacking_order_iterator.h"
- >
- </File>
- <File
- RelativePath=".\webaccessibilitymanager_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webaccessibilitymanager_impl.h"
- >
- </File>
- <File
- RelativePath=".\webclipboard_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webclipboard_impl.h"
- >
- </File>
- <File
- RelativePath=".\webcursor.cc"
- >
- </File>
- <File
- RelativePath=".\webcursor.h"
- >
- </File>
- <File
- RelativePath=".\webcursor_win.cc"
- >
- </File>
- <File
- RelativePath=".\webdatasource_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webdatasource_impl.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsagent_impl.h"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webdevtoolsclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\webdropdata.cc"
- >
- </File>
- <File
- RelativePath=".\webdropdata.h"
- >
- </File>
- <File
- RelativePath=".\webdropdata_win.cc"
- >
- </File>
- <File
- RelativePath=".\weberror_impl.cc"
- >
- </File>
- <File
- RelativePath=".\weberror_impl.h"
- >
- </File>
- <File
- RelativePath=".\webframe_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webframe_impl.h"
- >
- </File>
- <File
- RelativePath=".\webframeloaderclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webframeloaderclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\webhistoryitem_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webhistoryitem_impl.h"
- >
- </File>
- <File
- RelativePath=".\webkit_glue.cc"
- >
- </File>
- <File
- RelativePath=".\webkit_glue.h"
- >
- </File>
- <File
- RelativePath=".\webkitclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webkitclient_impl.h"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webmediaplayer_impl.h"
- >
- </File>
- <File
- RelativePath=".\webplugin_delegate.cc"
- >
- </File>
- <File
- RelativePath=".\webplugin_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webplugin_impl.h"
- >
- </File>
- <File
- RelativePath=".\webresponse_impl.h"
- >
- </File>
- <File
- RelativePath=".\webscriptsource.h"
- >
- </File>
- <File
- RelativePath=".\webtextinput_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webtextinput_impl.h"
- >
- </File>
- <File
- RelativePath=".\webthemeengine_impl_win.cc"
- >
- </File>
- <File
- RelativePath=".\webthemeengine_impl_win.h"
- >
- </File>
- <File
- RelativePath=".\weburlrequest_impl.cc"
- >
- </File>
- <File
- RelativePath=".\weburlrequest_impl.h"
- >
- </File>
- <File
- RelativePath=".\webview_delegate.cc"
- >
- </File>
- <File
- RelativePath=".\webview_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webview_impl.h"
- >
- </File>
- <File
- RelativePath=".\webwidget_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webwidget_impl.h"
- >
- </File>
- <File
- RelativePath=".\webworker_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webworker_impl.h"
- >
- </File>
- <File
- RelativePath=".\webworkerclient_impl.cc"
- >
- </File>
- <File
- RelativePath=".\webworkerclient_impl.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Plugins"
- >
- <File
- RelativePath=".\plugins\mozilla_extensions.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\mozilla_extensions.h"
- >
- </File>
- <File
- RelativePath=".\plugins\nphostapi.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_constants_win.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_host.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_host.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_instance.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_instance.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_lib.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_lib.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_lib_win.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_list.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_list.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_list_win.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream_url.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream_url.h"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_stream_win.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_string_stream.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\plugin_string_stream.h"
- >
- </File>
- <File
- RelativePath=".\plugins\webplugin_delegate_impl.cc"
- >
- </File>
- <File
- RelativePath=".\plugins\webplugin_delegate_impl.h"
- >
- </File>
- </Filter>
- <Filter
- Name="DevTools"
- >
- <File
- RelativePath=".\devtools\debugger_agent.h"
- >
- </File>
- <File
- RelativePath=".\devtools\debugger_agent_impl.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\debugger_agent_impl.h"
- >
- </File>
- <File
- RelativePath=".\devtools\debugger_agent_manager.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\debugger_agent_manager.h"
- >
- </File>
- <File
- RelativePath=".\devtools\devtools_rpc.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\devtools_rpc.h"
- >
- </File>
- <File
- RelativePath=".\devtools\devtools_rpc_js.h"
- >
- </File>
- <File
- RelativePath=".\devtools\dom_agent.h"
- >
- </File>
- <File
- RelativePath=".\devtools\dom_agent_impl.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\dom_agent_impl.h"
- >
- </File>
- <File
- RelativePath=".\devtools\net_agent.h"
- >
- </File>
- <File
- RelativePath=".\devtools\net_agent_impl.cc"
- >
- </File>
- <File
- RelativePath=".\devtools\net_agent_impl.h"
- >
- </File>
- <File
- RelativePath=".\devtools\tools_agent.h"
- >
- </File>
- <Filter
- Name="js"
- >
- <File
- RelativePath=".\devtools\js\base.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\debugger_agent.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\devtools.html"
- >
- </File>
- <File
- RelativePath=".\devtools\js\devtools.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\devtools_callback.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\devtools_host_stub.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\dom_agent.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\inject.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\inspector_controller.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\inspector_controller_impl.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\json.js"
- >
- </File>
- <File
- RelativePath=".\devtools\js\net_agent.js"
- >
- </File>
- </Filter>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="Glue" + ProjectGUID="{C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09}" + RootNamespace="glue" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + <ToolFile + RelativePath=".\devtools\devtools_copy.rules" + /> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + ConfigurationType="4" + InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\glue.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="devtools file copy" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="4" + InheritedPropertySheets="..\..\build\release.vsprops;.\glue.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="devtools file copy" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="API" + > + <File + RelativePath=".\autofill_form.cc" + > + </File> + <File + RelativePath=".\autofill_form.h" + > + </File> + <File + RelativePath=".\context_menu.h" + > + </File> + <File + RelativePath=".\cpp_bound_class.h" + > + </File> + <File + RelativePath=".\cpp_variant.h" + > + </File> + <File + RelativePath=".\dom_operations.h" + > + </File> + <File + RelativePath=".\form_data.h" + > + </File> + <File + RelativePath=".\image_decoder.h" + > + </File> + <File + RelativePath=".\password_form.h" + > + </File> + <File + RelativePath=".\resource_type.h" + > + </File> + <File + RelativePath=".\screen_info.h" + > + </File> + <File + RelativePath=".\webaccessibility.h" + > + </File> + <File + RelativePath=".\webaccessibilitymanager.h" + > + </File> + <File + RelativePath=".\webappcachecontext.cc" + > + </File> + <File + RelativePath=".\webappcachecontext.h" + > + </File> + <File + RelativePath=".\webdatasource.h" + > + </File> + <File + RelativePath=".\webdevtoolsagent.h" + > + </File> + <File + RelativePath=".\webdevtoolsagent_delegate.h" + > + </File> + <File + RelativePath=".\webdevtoolsclient.h" + > + </File> + <File + RelativePath=".\webdevtoolsclient_delegate.h" + > + </File> + <File + RelativePath=".\weberror.h" + > + </File> + <File + RelativePath=".\webframe.h" + > + </File> + <File + RelativePath=".\webhistoryitem.h" + > + </File> + <File + RelativePath=".\webplugin.h" + > + </File> + <File + RelativePath=".\webplugin_delegate.h" + > + </File> + <File + RelativePath=".\webplugininfo.h" + > + </File> + <File + RelativePath=".\webpreferences.h" + > + </File> + <File + RelativePath=".\webresponse.h" + > + </File> + <File + RelativePath=".\webtextinput.h" + > + </File> + <File + RelativePath=".\weburlrequest.h" + > + </File> + <File + RelativePath=".\webview.h" + > + </File> + <File + RelativePath=".\webview_delegate.h" + > + </File> + <File + RelativePath=".\webwidget.h" + > + </File> + <File + RelativePath=".\webwidget_delegate.h" + > + </File> + <File + RelativePath=".\webworker.h" + > + </File> + <File + RelativePath=".\webworkerclient.h" + > + </File> + <File + RelativePath=".\window_open_disposition.h" + > + </File> + </Filter> + <Filter + Name="Library" + > + <File + RelativePath=".\alt_404_page_resource_fetcher.cc" + > + </File> + <File + RelativePath=".\alt_404_page_resource_fetcher.h" + > + </File> + <File + RelativePath=".\alt_error_page_resource_fetcher.cc" + > + </File> + <File + RelativePath=".\alt_error_page_resource_fetcher.h" + > + </File> + <File + RelativePath=".\back_forward_list_client_impl.cc" + > + </File> + <File + RelativePath=".\back_forward_list_client_impl.h" + > + </File> + <File + RelativePath=".\chrome_client_impl.cc" + > + </File> + <File + RelativePath=".\chrome_client_impl.h" + > + </File> + <File + RelativePath=".\chromium_bridge_impl.cc" + > + </File> + <File + RelativePath=".\context_menu_client_impl.cc" + > + </File> + <File + RelativePath=".\context_menu_client_impl.h" + > + </File> + <File + RelativePath=".\cpp_binding_example.cc" + > + </File> + <File + RelativePath=".\cpp_bound_class.cc" + > + </File> + <File + RelativePath=".\cpp_variant.cc" + > + </File> + <File + RelativePath=".\debugger_bridge.cc" + > + </File> + <File + RelativePath=".\debugger_bridge.h" + > + </File> + <File + RelativePath=".\dom_operations.cc" + > + </File> + <File + RelativePath=".\dom_operations_private.h" + > + </File> + <File + RelativePath=".\dom_serializer.cc" + > + </File> + <File + RelativePath=".\dom_serializer.h" + > + </File> + <File + RelativePath=".\dom_serializer_delegate.h" + > + </File> + <File + RelativePath=".\dragclient_impl.cc" + > + </File> + <File + RelativePath=".\dragclient_impl.h" + > + </File> + <File + RelativePath=".\editor_client_impl.cc" + > + </File> + <File + RelativePath=".\editor_client_impl.h" + > + </File> + <File + RelativePath=".\entity_map.cc" + > + </File> + <File + RelativePath=".\entity_map.h" + > + </File> + <File + RelativePath=".\event_conversion.cc" + > + </File> + <File + RelativePath=".\event_conversion.h" + > + </File> + <File + RelativePath=".\feed_preview.cc" + > + </File> + <File + RelativePath=".\feed_preview.h" + > + </File> + <File + RelativePath=".\glue_accessibility_object.cc" + > + </File> + <File + RelativePath=".\glue_accessibility_object.h" + > + </File> + <File + RelativePath=".\glue_serialize.cc" + > + </File> + <File + RelativePath=".\glue_serialize.h" + > + </File> + <File + RelativePath=".\glue_util.cc" + > + </File> + <File + RelativePath=".\glue_util.h" + > + </File> + <File + RelativePath=".\image_decoder.cc" + > + </File> + <File + RelativePath=".\image_resource_fetcher.cc" + > + </File> + <File + RelativePath=".\image_resource_fetcher.h" + > + </File> + <File + RelativePath=".\inspector_client_impl.cc" + > + </File> + <File + RelativePath=".\inspector_client_impl.h" + > + </File> + <File + RelativePath=".\localized_strings.cc" + > + </File> + <File + RelativePath=".\media_player_private_impl.cc" + > + </File> + <File + RelativePath=".\multipart_response_delegate.cc" + > + </File> + <File + RelativePath=".\multipart_response_delegate.h" + > + </File> + <File + RelativePath=".\npruntime_util.cc" + > + </File> + <File + RelativePath=".\npruntime_util.h" + > + </File> + <File + RelativePath=".\password_autocomplete_listener.cc" + > + </File> + <File + RelativePath=".\password_autocomplete_listener.h" + > + </File> + <File + RelativePath=".\password_form_dom_manager.cc" + > + </File> + <File + RelativePath=".\password_form_dom_manager.h" + > + </File> + <File + RelativePath=".\resource.h" + > + </File> + <File + RelativePath=".\resource_fetcher.cc" + > + </File> + <File + RelativePath=".\resource_fetcher.h" + > + </File> + <File + RelativePath=".\resource_handle_impl.cc" + > + </File> + <File + RelativePath=".\resource_loader_bridge.cc" + > + </File> + <File + RelativePath=".\resource_loader_bridge.h" + > + </File> + <File + RelativePath=".\scoped_clipboard_writer_glue.h" + > + </File> + <File + RelativePath=".\searchable_form_data.cc" + > + </File> + <File + RelativePath=".\searchable_form_data.h" + > + </File> + <File + RelativePath=".\simple_webmimeregistry_impl.cc" + > + </File> + <File + RelativePath=".\simple_webmimeregistry_impl.h" + > + </File> + <File + RelativePath=".\stacking_order_iterator.cc" + > + </File> + <File + RelativePath=".\stacking_order_iterator.h" + > + </File> + <File + RelativePath=".\webaccessibilitymanager_impl.cc" + > + </File> + <File + RelativePath=".\webaccessibilitymanager_impl.h" + > + </File> + <File + RelativePath=".\webclipboard_impl.cc" + > + </File> + <File + RelativePath=".\webclipboard_impl.h" + > + </File> + <File + RelativePath=".\webcursor.cc" + > + </File> + <File + RelativePath=".\webcursor.h" + > + </File> + <File + RelativePath=".\webcursor_win.cc" + > + </File> + <File + RelativePath=".\webdatasource_impl.cc" + > + </File> + <File + RelativePath=".\webdatasource_impl.h" + > + </File> + <File + RelativePath=".\webdevtoolsagent_impl.cc" + > + </File> + <File + RelativePath=".\webdevtoolsagent_impl.h" + > + </File> + <File + RelativePath=".\webdevtoolsclient_impl.cc" + > + </File> + <File + RelativePath=".\webdevtoolsclient_impl.h" + > + </File> + <File + RelativePath=".\webdropdata.cc" + > + </File> + <File + RelativePath=".\webdropdata.h" + > + </File> + <File + RelativePath=".\webdropdata_win.cc" + > + </File> + <File + RelativePath=".\weberror_impl.cc" + > + </File> + <File + RelativePath=".\weberror_impl.h" + > + </File> + <File + RelativePath=".\webframe_impl.cc" + > + </File> + <File + RelativePath=".\webframe_impl.h" + > + </File> + <File + RelativePath=".\webframeloaderclient_impl.cc" + > + </File> + <File + RelativePath=".\webframeloaderclient_impl.h" + > + </File> + <File + RelativePath=".\webhistoryitem_impl.cc" + > + </File> + <File + RelativePath=".\webhistoryitem_impl.h" + > + </File> + <File + RelativePath=".\webkit_glue.cc" + > + </File> + <File + RelativePath=".\webkit_glue.h" + > + </File> + <File + RelativePath=".\webkitclient_impl.cc" + > + </File> + <File + RelativePath=".\webkitclient_impl.h" + > + </File> + <File + RelativePath=".\webmediaplayerclient_impl.cc" + > + </File> + <File + RelativePath=".\webmediaplayerclient_impl.h" + > + </File> + <File + RelativePath=".\webplugin_delegate.cc" + > + </File> + <File + RelativePath=".\webplugin_impl.cc" + > + </File> + <File + RelativePath=".\webplugin_impl.h" + > + </File> + <File + RelativePath=".\webresponse_impl.h" + > + </File> + <File + RelativePath=".\webscriptsource.h" + > + </File> + <File + RelativePath=".\webtextinput_impl.cc" + > + </File> + <File + RelativePath=".\webtextinput_impl.h" + > + </File> + <File + RelativePath=".\webthemeengine_impl_win.cc" + > + </File> + <File + RelativePath=".\webthemeengine_impl_win.h" + > + </File> + <File + RelativePath=".\weburlrequest_impl.cc" + > + </File> + <File + RelativePath=".\weburlrequest_impl.h" + > + </File> + <File + RelativePath=".\webview_delegate.cc" + > + </File> + <File + RelativePath=".\webview_impl.cc" + > + </File> + <File + RelativePath=".\webview_impl.h" + > + </File> + <File + RelativePath=".\webwidget_impl.cc" + > + </File> + <File + RelativePath=".\webwidget_impl.h" + > + </File> + <File + RelativePath=".\webworker_impl.cc" + > + </File> + <File + RelativePath=".\webworker_impl.h" + > + </File> + <File + RelativePath=".\webworkerclient_impl.cc" + > + </File> + <File + RelativePath=".\webworkerclient_impl.h" + > + </File> + </Filter> + <Filter + Name="Plugins" + > + <File + RelativePath=".\plugins\mozilla_extensions.cc" + > + </File> + <File + RelativePath=".\plugins\mozilla_extensions.h" + > + </File> + <File + RelativePath=".\plugins\nphostapi.h" + > + </File> + <File + RelativePath=".\plugins\plugin_constants_win.h" + > + </File> + <File + RelativePath=".\plugins\plugin_host.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_host.h" + > + </File> + <File + RelativePath=".\plugins\plugin_instance.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_instance.h" + > + </File> + <File + RelativePath=".\plugins\plugin_lib.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_lib.h" + > + </File> + <File + RelativePath=".\plugins\plugin_lib_win.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_list.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_list.h" + > + </File> + <File + RelativePath=".\plugins\plugin_list_win.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_stream.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_stream.h" + > + </File> + <File + RelativePath=".\plugins\plugin_stream_url.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_stream_url.h" + > + </File> + <File + RelativePath=".\plugins\plugin_stream_win.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_string_stream.cc" + > + </File> + <File + RelativePath=".\plugins\plugin_string_stream.h" + > + </File> + <File + RelativePath=".\plugins\webplugin_delegate_impl.cc" + > + </File> + <File + RelativePath=".\plugins\webplugin_delegate_impl.h" + > + </File> + </Filter> + <Filter + Name="DevTools" + > + <File + RelativePath=".\devtools\debugger_agent.h" + > + </File> + <File + RelativePath=".\devtools\debugger_agent_impl.cc" + > + </File> + <File + RelativePath=".\devtools\debugger_agent_impl.h" + > + </File> + <File + RelativePath=".\devtools\debugger_agent_manager.cc" + > + </File> + <File + RelativePath=".\devtools\debugger_agent_manager.h" + > + </File> + <File + RelativePath=".\devtools\devtools_rpc.cc" + > + </File> + <File + RelativePath=".\devtools\devtools_rpc.h" + > + </File> + <File + RelativePath=".\devtools\devtools_rpc_js.h" + > + </File> + <File + RelativePath=".\devtools\dom_agent.h" + > + </File> + <File + RelativePath=".\devtools\dom_agent_impl.cc" + > + </File> + <File + RelativePath=".\devtools\dom_agent_impl.h" + > + </File> + <File + RelativePath=".\devtools\net_agent.h" + > + </File> + <File + RelativePath=".\devtools\net_agent_impl.cc" + > + </File> + <File + RelativePath=".\devtools\net_agent_impl.h" + > + </File> + <File + RelativePath=".\devtools\tools_agent.h" + > + </File> + <Filter + Name="js" + > + <File + RelativePath=".\devtools\js\base.js" + > + </File> + <File + RelativePath=".\devtools\js\debugger_agent.js" + > + </File> + <File + RelativePath=".\devtools\js\devtools.html" + > + </File> + <File + RelativePath=".\devtools\js\devtools.js" + > + </File> + <File + RelativePath=".\devtools\js\devtools_callback.js" + > + </File> + <File + RelativePath=".\devtools\js\devtools_host_stub.js" + > + </File> + <File + RelativePath=".\devtools\js\dom_agent.js" + > + </File> + <File + RelativePath=".\devtools\js\inject.js" + > + </File> + <File + RelativePath=".\devtools\js\inspector_controller.js" + > + </File> + <File + RelativePath=".\devtools\js\inspector_controller_impl.js" + > + </File> + <File + RelativePath=".\devtools\js\json.js" + > + </File> + <File + RelativePath=".\devtools\js\net_agent.js" + > + </File> + </Filter> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/webkit/glue/media_player_private_impl.cc b/webkit/glue/media_player_private_impl.cc index 7bc09a3..15661b5 100644 --- a/webkit/glue/media_player_private_impl.cc +++ b/webkit/glue/media_player_private_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,335 +6,19 @@ #if ENABLE(VIDEO) -#include "Document.h" -#include "GraphicsContext.h" -#include "HTMLMediaElement.h" -#include "IntRect.h" #include "MediaPlayerPrivateChromium.h" -#include "NotImplemented.h" -#include "PlatformContextSkia.h" -#undef LOG -#include "base/gfx/rect.h" -#include "googleurl/src/gurl.h" -#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSize.h" -#include "webkit/glue/glue_util.h" -#include "webkit/glue/webframe.h" #include "webkit/glue/webkit_glue.h" -#include "webkit/glue/webmediaplayer.h" -#include "webkit/glue/webmediaplayer_impl.h" -#include "webkit/glue/webmediaplayer_delegate.h" -#include "webkit/glue/webview.h" -#include "webkit/glue/webview_delegate.h" +#include "webkit/glue/webmediaplayerclient_impl.h" namespace WebCore { -// To avoid exposing a glue type like this in WebCore, MediaPlayerPrivate -// defines a private field m_data as type void*. This method is used to -// cast that to a WebMediaPlayerDelegate pointer. -static inline webkit_glue::WebMediaPlayerDelegate* AsDelegate(void* data) { - return static_cast<webkit_glue::WebMediaPlayerDelegate*>(data); -} - -// We can't create the delegate here because m_player->frameView is null at -// this moment. Although we can static_cast the MediaPlayerClient to -// HTMLElement and get the frame from there, but creating the delegate from -// load() seems to be a better idea. -MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player) - : m_player(player), - m_data(NULL) { -} - -MediaPlayerPrivate::~MediaPlayerPrivate() { - // Delete the delegate, it should delete the associated WebMediaPlayer. - delete AsDelegate(m_data); -} - -void MediaPlayerPrivate::load(const String& url) { - // Delete the delegate if it already exists. Because we may be in a different - // view since last load. WebMediaPlayer uses the view internally when - // using ResourceHandle, WebMediaPlayerDelegate contains the actual media - // player, in order to hook the actual media player with ResourceHandle in - // WebMediaPlayer given the new view, we destroy the old - // WebMediaPlayerDelegate and WebMediaPlayer and create a new set of both. - delete AsDelegate(m_data); - m_data = NULL; - - webkit_glue::WebMediaPlayer* media_player = - new webkit_glue::WebMediaPlayerImpl(this); - WebViewDelegate* d = media_player->GetWebFrame()->GetView()->GetDelegate(); - - webkit_glue::WebMediaPlayerDelegate* new_delegate = - d->CreateMediaPlayerDelegate(); - // In case we couldn't create a delegate. - if (new_delegate) { - m_data = new_delegate; - new_delegate->Initialize(media_player); - media_player->Initialize(new_delegate); - - new_delegate->Load(webkit_glue::StringToGURL(url)); - } -} - -void MediaPlayerPrivate::cancelLoad() { - if (m_data) - AsDelegate(m_data)->CancelLoad(); -} - -IntSize MediaPlayerPrivate::naturalSize() const { - if (m_data) { - return IntSize(AsDelegate(m_data)->GetWidth(), - AsDelegate(m_data)->GetHeight()); - } else { - return IntSize(0, 0); - } -} - -bool MediaPlayerPrivate::hasVideo() const { - if (m_data) { - return AsDelegate(m_data)->IsVideo(); - } else { - return false; - } -} - -void MediaPlayerPrivate::play() { - if (m_data) { - AsDelegate(m_data)->Play(); - } -} - -void MediaPlayerPrivate::pause() { - if (m_data) { - AsDelegate(m_data)->Pause(); - } -} - -bool MediaPlayerPrivate::paused() const { - if (m_data) { - return AsDelegate(m_data)->IsPaused(); - } else { - return true; - } -} - -bool MediaPlayerPrivate::seeking() const { - if (m_data) { - return AsDelegate(m_data)->IsSeeking(); - } else { - return false; - } -} - -float MediaPlayerPrivate::duration() const { - if (m_data) { - return AsDelegate(m_data)->GetDuration(); - } else { - return 0.0f; - } -} - -float MediaPlayerPrivate::currentTime() const { - if (m_data) { - return AsDelegate(m_data)->GetCurrentTime(); - } else { - return 0.0f; - } -} - -void MediaPlayerPrivate::seek(float time) { - if (m_data) { - AsDelegate(m_data)->Seek(time); - } -} - -void MediaPlayerPrivate::setEndTime(float time) { - if (m_data) { - AsDelegate(m_data)->SetEndTime(time); - } -} - -void MediaPlayerPrivate::setRate(float rate) { - if (m_data) { - AsDelegate(m_data)->SetPlaybackRate(rate); - } -} - -void MediaPlayerPrivate::setVolume(float volume) { - if (m_data) { - AsDelegate(m_data)->SetVolume(volume); - } -} - -int MediaPlayerPrivate::dataRate() const { - if (m_data) { - return AsDelegate(m_data)->GetDataRate(); - } else { - return 0; - } -} - -MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const { - if (m_data) { - switch (AsDelegate(m_data)->GetNetworkState()) { - case webkit_glue::WebMediaPlayer::EMPTY: - return MediaPlayer::Empty; - case webkit_glue::WebMediaPlayer::IDLE: - return MediaPlayer::Idle; - case webkit_glue::WebMediaPlayer::LOADING: - return MediaPlayer::Loading; - case webkit_glue::WebMediaPlayer::LOADED: - return MediaPlayer::Loaded; - case webkit_glue::WebMediaPlayer::FORMAT_ERROR: - return MediaPlayer::FormatError; - case webkit_glue::WebMediaPlayer::NETWORK_ERROR: - return MediaPlayer::NetworkError; - case webkit_glue::WebMediaPlayer::DECODE_ERROR: - return MediaPlayer::DecodeError; - } - } - return MediaPlayer::Empty; -} - -MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const { - if (m_data) { - switch (AsDelegate(m_data)->GetReadyState()) { - case webkit_glue::WebMediaPlayer::HAVE_NOTHING: - return MediaPlayer::HaveNothing; - case webkit_glue::WebMediaPlayer::HAVE_METADATA: - return MediaPlayer::HaveMetadata; - case webkit_glue::WebMediaPlayer::HAVE_CURRENT_DATA: - return MediaPlayer::HaveCurrentData; - case webkit_glue::WebMediaPlayer::HAVE_FUTURE_DATA: - return MediaPlayer::HaveFutureData; - case webkit_glue::WebMediaPlayer::HAVE_ENOUGH_DATA: - return MediaPlayer::HaveEnoughData; - } - } - return MediaPlayer::HaveNothing; -} - -float MediaPlayerPrivate::maxTimeBuffered() const { - if (m_data) { - return AsDelegate(m_data)->GetMaxTimeBuffered(); - } else { - return 0.0f; - } -} - -float MediaPlayerPrivate::maxTimeSeekable() const { - if (m_data) { - return AsDelegate(m_data)->GetMaxTimeSeekable(); - } else { - return 0.0f; - } -} - -unsigned MediaPlayerPrivate::bytesLoaded() const { - if (m_data) { - return static_cast<unsigned>(AsDelegate(m_data)->GetBytesLoaded()); - } else { - return 0; - } -} - -bool MediaPlayerPrivate::totalBytesKnown() const { - if (m_data) { - return AsDelegate(m_data)->IsTotalBytesKnown(); - } else { - return false; - } -} - -unsigned MediaPlayerPrivate::totalBytes() const { - if (m_data) { - return static_cast<unsigned>(AsDelegate(m_data)->GetTotalBytes()); - } else { - return 0; - } -} - -void MediaPlayerPrivate::setVisible(bool visible) { - if (m_data) { - AsDelegate(m_data)->SetVisible(visible); - } -} - -void MediaPlayerPrivate::setSize(const IntSize& size) { - if (m_data) { - AsDelegate(m_data)->SetSize(webkit_glue::IntSizeToWebSize(size)); - } -} - -void MediaPlayerPrivate::paint(GraphicsContext* p, const IntRect& r) { - if (m_data) { - AsDelegate(m_data)->Paint(p->platformContext()->canvas(), - webkit_glue::IntRectToWebRect(r)); - } -} - -// Called from WebMediaPlayer ------------------------------------------------- -FrameView* MediaPlayerPrivate::frameView() { - // Unfortunately m_player->frameView() can be NULL for <audio> so get the - // FrameView from the document directly. - return static_cast<HTMLMediaElement*>( - m_player->mediaPlayerClient())->document()->view(); -} - -void MediaPlayerPrivate::networkStateChanged() { - m_player->networkStateChanged(); -} - -void MediaPlayerPrivate::readyStateChanged() { - m_player->readyStateChanged(); -} - -void MediaPlayerPrivate::timeChanged() { - m_player->timeChanged(); -} - -void MediaPlayerPrivate::volumeChanged() { - m_player->volumeChanged(); -} - -void MediaPlayerPrivate::repaint() { - m_player->repaint(); -} - -void MediaPlayerPrivate::sizeChanged() { - m_player->sizeChanged(); -} - -void MediaPlayerPrivate::rateChanged() { - m_player->rateChanged(); -} - -void MediaPlayerPrivate::durationChanged() { - m_player->durationChanged(); -} - -// public static methods ------------------------------------------------------ - -MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player) { - return new MediaPlayerPrivate(player); -} - void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar) { - if (webkit_glue::IsMediaPlayerAvailable()) - registrar(create, getSupportedTypes, supportsType); -} - -MediaPlayer::SupportsType MediaPlayerPrivate::supportsType( - const String &type, const String &codecs) { - // TODO(hclam): decide what to do here, now we just say we support everything. - return MediaPlayer::IsSupported; -} - -void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types) { - // TODO(hclam): decide what to do here, we should fill in the HashSet about - // codecs that we support. - notImplemented(); + if (webkit_glue::IsMediaPlayerAvailable()) { + registrar(&WebMediaPlayerClientImpl::create, + &WebMediaPlayerClientImpl::getSupportedTypes, + &WebMediaPlayerClientImpl::supportsType); + } } } // namespace WebCore diff --git a/webkit/glue/webmediaplayer.h b/webkit/glue/webmediaplayer.h deleted file mode 100644 index 4d80cfa..0000000 --- a/webkit/glue/webmediaplayer.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -#ifndef WEBKIT_GLUE_WEBMEDIAPLAYER_H_ -#define WEBKIT_GLUE_WEBMEDIAPLAYER_H_ - -#include "base/basictypes.h" - -class WebFrame; - -namespace webkit_glue { - -class WebMediaPlayerDelegate; - -class WebMediaPlayer { -public: - enum NetworkState { - EMPTY, - IDLE, - LOADING, - LOADED, - FORMAT_ERROR, - NETWORK_ERROR, - DECODE_ERROR, - }; - - enum ReadyState { - HAVE_NOTHING, - HAVE_METADATA, - HAVE_CURRENT_DATA, - HAVE_FUTURE_DATA, - HAVE_ENOUGH_DATA, - }; - - WebMediaPlayer() {} - virtual ~WebMediaPlayer() {} - - virtual void Initialize(WebMediaPlayerDelegate* delegate) = 0; - - // Get the web frame associated with the media player - virtual WebFrame* GetWebFrame() = 0; - - // Notify the media player about network state change. - virtual void NotifyNetworkStateChange() = 0; - - // Notify the media player about ready state change. - virtual void NotifyReadyStateChange() = 0; - - // Notify the media player about time change. - virtual void NotifyTimeChange() = 0; - - // Notify the media player about volume change. - virtual void NotifyVolumeChange() = 0; - - // Notify the media player size of video frame changed. - virtual void NotifySizeChanged() = 0; - - // Notify the media player playback rate has changed. - virtual void NotifyRateChanged() = 0; - - // Notify the media player duration of the media file has changed. - virtual void NotifyDurationChanged() = 0; - - // Tell the media player to repaint itself. - virtual void Repaint() = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(WebMediaPlayer); -}; - -} // namespace webkit_glue - -#endif // WEBKIT_GLUE_WEBMEDIAPLAYER_H_ diff --git a/webkit/glue/webmediaplayer_delegate.h b/webkit/glue/webmediaplayer_delegate.h deleted file mode 100644 index c86b001..0000000 --- a/webkit/glue/webmediaplayer_delegate.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -#ifndef WEBKIT_GLUE_WEBMEDIAPLAYER_DELEGATE_H_ -#define WEBKIT_GLUE_WEBMEDIAPLAYER_DELEGATE_H_ - -#include "base/gfx/platform_canvas.h" -#include "webkit/glue/weberror.h" -#include "webkit/glue/webmediaplayer.h" -#include "webkit/glue/webresponse.h" -#include "webkit/glue/weburlrequest.h" - -class GURL; - -namespace WebKit { -struct WebRect; -struct WebSize; -} - -namespace webkit_glue { - -class WebMediaPlayerDelegate { - public: - WebMediaPlayerDelegate() {} - virtual ~WebMediaPlayerDelegate() {} - - virtual void Initialize(WebMediaPlayer *web_media_player) = 0; - - virtual void Load(const GURL& url) = 0; - virtual void CancelLoad() = 0; - - // Playback controls. - virtual void Play() = 0; - virtual void Pause() = 0; - virtual void Stop() = 0; - virtual void Seek(float time) = 0; - virtual void SetEndTime(float time) = 0; - virtual void SetPlaybackRate(float rate) = 0; - virtual void SetVolume(float volume) = 0; - virtual void SetVisible(bool visible) = 0; - virtual bool IsTotalBytesKnown() = 0; - virtual float GetMaxTimeBuffered() const = 0; - virtual float GetMaxTimeSeekable() const = 0; - - // Methods for painting. - virtual void SetSize(const WebKit::WebSize& size) = 0; - - // TODO(hclam): Using paint at the moment, maybe we just need to return a - // SkiaBitmap? - virtual void Paint(skia::PlatformCanvas *canvas, - const WebKit::WebRect& rect) = 0; - - // True if a video is loaded. - virtual bool IsVideo() const = 0; - - // Dimension of the video. - virtual size_t GetWidth() const = 0; - virtual size_t GetHeight() const = 0; - - // Getters fo playback state. - virtual bool IsPaused() const = 0; - virtual bool IsSeeking() const = 0; - virtual float GetDuration() const = 0; - virtual float GetCurrentTime() const = 0; - virtual float GetPlayBackRate() const = 0; - virtual float GetVolume() const = 0; - - // Get rate of loading the resource. - virtual int32 GetDataRate() const = 0; - - // Internal states of loading and network. - virtual WebMediaPlayer::NetworkState GetNetworkState() const = 0; - virtual WebMediaPlayer::ReadyState GetReadyState() const = 0; - - virtual int64 GetBytesLoaded() const = 0; - virtual int64 GetTotalBytes() const = 0; - - private: - DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerDelegate); -}; - -} // namespace webkit_glue - -#endif // WEBKIT_GLUE_WEBMEDIAPLAYER_DELEGATE_H_ diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc deleted file mode 100644 index 1a17346..0000000 --- a/webkit/glue/webmediaplayer_impl.cc +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -#include "config.h" - -#include "FrameView.h" -#include "MediaPlayerPrivateChromium.h" -#include "PlatformString.h" -#include "ResourceRequest.h" -#include "ResourceHandle.h" -#undef LOG - -#include "googleurl/src/gurl.h" -#include "webkit/glue/glue_util.h" -#include "webkit/glue/weberror_impl.h" -#include "webkit/glue/webframe_impl.h" -#include "webkit/glue/webmediaplayer_delegate.h" -#include "webkit/glue/webmediaplayer_impl.h" -#include "webkit/glue/webresponse_impl.h" -#include "webkit/glue/weburlrequest_impl.h" - -#if ENABLE(VIDEO) - -namespace webkit_glue { - -WebMediaPlayerImpl::WebMediaPlayerImpl( - WebCore::MediaPlayerPrivate* media_player_private) - : media_player_private_(media_player_private) { -} - -WebMediaPlayerImpl::~WebMediaPlayerImpl() { -} - -void WebMediaPlayerImpl::Initialize(WebMediaPlayerDelegate* delegate){ - delegate_ = delegate; -} - -WebFrame* WebMediaPlayerImpl::GetWebFrame() { - if (media_player_private_ && media_player_private_->frameView()->frame()) { - return WebFrameImpl::FromFrame( - media_player_private_->frameView()->frame()); - } else { - return NULL; - } -} - -void WebMediaPlayerImpl::NotifyNetworkStateChange() { - if (media_player_private_) - media_player_private_->networkStateChanged(); -} - -void WebMediaPlayerImpl::NotifyReadyStateChange() { - if (media_player_private_) - media_player_private_->readyStateChanged(); -} - -void WebMediaPlayerImpl::NotifyTimeChange() { - if (media_player_private_) - media_player_private_->timeChanged(); -} - -void WebMediaPlayerImpl::NotifyVolumeChange() { - if (media_player_private_) - media_player_private_->volumeChanged(); -} - -void WebMediaPlayerImpl::NotifySizeChanged() { - if (media_player_private_) - media_player_private_->sizeChanged(); -} - -void WebMediaPlayerImpl::NotifyRateChanged() { - if (media_player_private_) - media_player_private_->rateChanged(); -} - -void WebMediaPlayerImpl::NotifyDurationChanged() { - if (media_player_private_) - media_player_private_->durationChanged(); -} - -void WebMediaPlayerImpl::Repaint() { - if (media_player_private_) - media_player_private_->repaint(); -} - -} // namespace webkit_glue - -#endif // ENABLE(VIDEO) diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h deleted file mode 100644 index 3dc29e5..0000000 --- a/webkit/glue/webmediaplayer_impl.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. -// -// Wrapper over WebCore::MediaPlayerPrivate. It also would handle resource -// loading for the internal media player. - -#ifndef WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ -#define WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ - -#include "webkit/glue/webmediaplayer.h" - -#if ENABLE(VIDEO) - -namespace WebCore { -class MediaPlayerPrivate; -class ResourceHandle; -} - -namespace webkit_glue { - -class WebMediaPlayerDelegate; - -class WebMediaPlayerImpl : public WebMediaPlayer { - public: - explicit WebMediaPlayerImpl( - WebCore::MediaPlayerPrivate* media_player_private); - - virtual ~WebMediaPlayerImpl(); - - virtual void Initialize(WebMediaPlayerDelegate* delegate); - - // Get the web frame associated with the media player - virtual WebFrame* GetWebFrame(); - - // Notify the media player about network state change. - virtual void NotifyNetworkStateChange(); - - // Notify the media player about ready state change. - virtual void NotifyReadyStateChange(); - - // Notify the media player about time change. - virtual void NotifyTimeChange(); - - // Notify the media player about volume change. - virtual void NotifyVolumeChange(); - - // Notify the media player size of video frame changed. - virtual void NotifySizeChanged(); - - // Notify the media player playback rate has changed. - virtual void NotifyRateChanged(); - - // Notify the media player duration of the media file has changed. - virtual void NotifyDurationChanged(); - - // Tell the media player to repaint itself. - virtual void Repaint(); - - private: - WebCore::MediaPlayerPrivate* media_player_private_; - WebMediaPlayerDelegate* delegate_; - - DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); -}; - -} // namespace webkit_glue - -#endif // ENABLE(VIDEO) - -#endif // WEBKIT_GLUE_WEBMEDIAPLAYER_H_ diff --git a/webkit/glue/webmediaplayerclient_impl.cc b/webkit/glue/webmediaplayerclient_impl.cc new file mode 100644 index 0000000..ebd2e57 --- /dev/null +++ b/webkit/glue/webmediaplayerclient_impl.cc @@ -0,0 +1,307 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" +#include "webkit/glue/webmediaplayerclient_impl.h" + +#if ENABLE(VIDEO) + +#include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h" +#include "third_party/WebKit/WebKit/chromium/public/WebCString.h" +#include "third_party/WebKit/WebKit/chromium/public/WebKit.h" +#include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayer.h" +#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" +#include "third_party/WebKit/WebKit/chromium/public/WebSize.h" +#include "third_party/WebKit/WebKit/chromium/public/WebString.h" +#include "third_party/WebKit/WebKit/chromium/public/WebURL.h" +#include "webkit/glue/webframe_impl.h" +#include "webkit/glue/webview.h" +#include "webkit/glue/webview_delegate.h" + +#include "CString.h" +#include "Frame.h" +#include "GraphicsContext.h" +#include "HTMLMediaElement.h" +#include "IntSize.h" +#include "MediaPlayer.h" +#include "NotImplemented.h" +#include "PlatformContextSkia.h" + +using namespace WebCore; +using namespace WebKit; + +WebMediaPlayerClientImpl::WebMediaPlayerClientImpl() + : m_webMediaPlayer(0) { +} + + +WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl() { + delete m_webMediaPlayer; +} + +////////////////////////////////////////////////////////////////////////////// +// WebMediaPlayerClientImpl, WebMediaPlayerClient implementations +void WebMediaPlayerClientImpl::networkStateChanged() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->networkStateChanged(); +} + +void WebMediaPlayerClientImpl::readyStateChanged() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->readyStateChanged(); +} + +void WebMediaPlayerClientImpl::volumeChanged() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->volumeChanged(); +} + +void WebMediaPlayerClientImpl::timeChanged() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->timeChanged(); +} + +void WebMediaPlayerClientImpl::repaint() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->repaint(); +} + +void WebMediaPlayerClientImpl::durationChanged() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->durationChanged(); +} + +void WebMediaPlayerClientImpl::rateChanged() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->rateChanged(); +} + +void WebMediaPlayerClientImpl::sizeChanged() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->sizeChanged(); +} + +void WebMediaPlayerClientImpl::sawUnsupportedTracks() { + ASSERT(m_mediaPlayer); + m_mediaPlayer->mediaPlayerClient()->mediaPlayerSawUnsupportedTracks( + m_mediaPlayer); +} + +////////////////////////////////////////////////////////////////////////////// +// WebMediaPlayerClientImpl, MediaPlayerPrivateInterface implementations +void WebMediaPlayerClientImpl::load(const String& url) { + delete m_webMediaPlayer; + + WebCore::Frame* frame = static_cast<HTMLMediaElement*>( + m_mediaPlayer->mediaPlayerClient())->document()->frame(); + WebFrame* webFrame = WebFrameImpl::FromFrame(frame); + WebViewDelegate* d = webFrame->GetView()->GetDelegate(); + m_webMediaPlayer = d->CreateWebMediaPlayer(this); + // TODO(hclam): Is there a simpler way to convert from WebCore::String to + // WebKit::WebURL? + m_webMediaPlayer->load(WebKit::WebURL(GURL(WebString::fromUTF8(url.utf8())))); +} + +void WebMediaPlayerClientImpl::cancelLoad() { + if (m_webMediaPlayer) + m_webMediaPlayer->cancelLoad(); +} + +void WebMediaPlayerClientImpl::play() { + if (m_webMediaPlayer) + m_webMediaPlayer->play(); +} + +void WebMediaPlayerClientImpl::pause() { + if (m_webMediaPlayer) + m_webMediaPlayer->pause(); +} + +IntSize WebMediaPlayerClientImpl::naturalSize() const { + if (m_webMediaPlayer) { + const WebSize& size = m_webMediaPlayer->naturalSize(); + return IntSize(size.width, size.height); + } + return IntSize(0, 0); +} + +bool WebMediaPlayerClientImpl::hasVideo() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->hasVideo(); + return false; +} + +void WebMediaPlayerClientImpl::setVisible(bool visible) { + if (m_webMediaPlayer) + m_webMediaPlayer->setVisible(visible); +} + +float WebMediaPlayerClientImpl::duration() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->duration(); + return 0.0f; +} + +float WebMediaPlayerClientImpl::currentTime() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->currentTime(); + return 0.0f; +} + +void WebMediaPlayerClientImpl::seek(float time) { + if (m_webMediaPlayer) + m_webMediaPlayer->seek(time); +} + +bool WebMediaPlayerClientImpl::seeking() const { + return m_webMediaPlayer->seeking(); +} + +void WebMediaPlayerClientImpl::setEndTime(float time) { + if (m_webMediaPlayer) + m_webMediaPlayer->setEndTime(time); +} + +void WebMediaPlayerClientImpl::setRate(float rate) { + if (m_webMediaPlayer) + m_webMediaPlayer->setRate(rate); +} + +bool WebMediaPlayerClientImpl::paused() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->paused(); + return false; +} + +void WebMediaPlayerClientImpl::setVolume(float volume) { + if (m_webMediaPlayer) + m_webMediaPlayer->setVolume(volume); +} + +MediaPlayer::NetworkState WebMediaPlayerClientImpl::networkState() const { + COMPILE_ASSERT( + int(WebMediaPlayer::Empty) == int(MediaPlayer::Empty), Empty); + COMPILE_ASSERT( + int(WebMediaPlayer::Idle) == int(MediaPlayer::Idle), Idle); + COMPILE_ASSERT( + int(WebMediaPlayer::Loading) == int(MediaPlayer::Loading), Loading); + COMPILE_ASSERT( + int(WebMediaPlayer::Loaded) == int(MediaPlayer::Loaded), Loaded); + COMPILE_ASSERT( + int(WebMediaPlayer::FormatError) == int(MediaPlayer::FormatError), + FormatError); + COMPILE_ASSERT( + int(WebMediaPlayer::NetworkError) == int(MediaPlayer::NetworkError), + NetworkError); + COMPILE_ASSERT( + int(WebMediaPlayer::DecodeError) == int(MediaPlayer::DecodeError), + DecodeError); + + if (m_webMediaPlayer) + return static_cast<MediaPlayer::NetworkState>( + m_webMediaPlayer->networkState()); + return MediaPlayer::Empty; +} + +MediaPlayer::ReadyState WebMediaPlayerClientImpl::readyState() const { + COMPILE_ASSERT( + int(WebMediaPlayer::HaveNothing) == int(MediaPlayer::HaveNothing), + HaveNothing); + COMPILE_ASSERT( + int(WebMediaPlayer::HaveMetadata) == int(MediaPlayer::HaveMetadata), + HaveMetadata); + COMPILE_ASSERT( + int(WebMediaPlayer::HaveCurrentData) == int(MediaPlayer::HaveCurrentData), + HaveCurrentData); + COMPILE_ASSERT( + int(WebMediaPlayer::HaveFutureData) == int(MediaPlayer::HaveFutureData), + HaveFutureData); + COMPILE_ASSERT( + int(WebMediaPlayer::HaveEnoughData) == int(MediaPlayer::HaveEnoughData), + HaveEnoughData); + + if (m_webMediaPlayer) + return static_cast<MediaPlayer::ReadyState>(m_webMediaPlayer->readyState()); + return MediaPlayer::HaveNothing; +} + +float WebMediaPlayerClientImpl::maxTimeSeekable() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->maxTimeSeekable(); + return 0.0f; +} + +float WebMediaPlayerClientImpl::maxTimeBuffered() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->maxTimeBuffered(); + return 0.0f; +} + +int WebMediaPlayerClientImpl::dataRate() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->dataRate(); + return 0; +} + +bool WebMediaPlayerClientImpl::totalBytesKnown() const { + if (m_webMediaPlayer) + return m_webMediaPlayer->totalBytesKnown(); + return false; +} + +unsigned WebMediaPlayerClientImpl::totalBytes() const { + if (m_webMediaPlayer) + return static_cast<unsigned>(m_webMediaPlayer->totalBytes()); + return 0; +} + +unsigned WebMediaPlayerClientImpl::bytesLoaded() const { + if (m_webMediaPlayer) + return static_cast<unsigned>(m_webMediaPlayer->bytesLoaded()); + return 0; +} + +void WebMediaPlayerClientImpl::setSize(const IntSize& size) { + if (m_webMediaPlayer) + m_webMediaPlayer->setSize(WebSize(size.width(), size.height())); +} + +void WebMediaPlayerClientImpl::paint(GraphicsContext* context, + const IntRect& rect) { + if (m_webMediaPlayer) + m_webMediaPlayer->paint( + context->platformContext()->canvas(), + WebRect(rect.x(), rect.y(), rect.width(), rect.height())); +} + +void WebMediaPlayerClientImpl::setAutobuffer(bool autoBuffer) { + if (m_webMediaPlayer) + m_webMediaPlayer->setAutoBuffer(autoBuffer); +} + +// static +MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create( + MediaPlayer* player) { + WebMediaPlayerClientImpl* client = new WebMediaPlayerClientImpl(); + client->m_mediaPlayer = player; + return client; +} + +// static +void WebMediaPlayerClientImpl::getSupportedTypes( + HashSet<String>& supportedTypes) { + // TODO(hclam): decide what to do here, we should fill in the HashSet about + // codecs that we support. + notImplemented(); +} + +// static +MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType( + const String& type, const String& codecs) { + // TODO(hclam): implement this nicely. + return MediaPlayer::IsSupported; +} + +#endif // ENABLE(VIDEO) diff --git a/webkit/glue/webmediaplayerclient_impl.h b/webkit/glue/webmediaplayerclient_impl.h new file mode 100644 index 0000000..5bbe9a3 --- /dev/null +++ b/webkit/glue/webmediaplayerclient_impl.h @@ -0,0 +1,101 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_GLUE_WEBMEDIAPLAYERCLIENT_IMPL_H_ +#define WEBKIT_GLUE_WEBMEDIAPLAYERCLIENT_IMPL_H_ + +#if ENABLE(VIDEO) + +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerClient.h" + +#include "MediaPlayerPrivate.h" + +namespace WebCore { +class MediaPlayerPrivate; +} // namespace WebCore + +namespace WebKit { +class WebMediaPlayer; +} // namespace WebKit + +class WebMediaPlayerClientImpl : public WebKit::WebMediaPlayerClient, + public WebCore::MediaPlayerPrivateInterface { + public: + virtual ~WebMediaPlayerClientImpl(); + + //////////////////////////////////////////////////////////////////////////// + // WebMediaPlayerPlayerClient methods + virtual void networkStateChanged(); + virtual void readyStateChanged(); + virtual void volumeChanged(); + virtual void timeChanged(); + virtual void repaint(); + virtual void durationChanged(); + virtual void rateChanged(); + virtual void sizeChanged(); + virtual void sawUnsupportedTracks(); + + //////////////////////////////////////////////////////////////////////////// + // MediaPlayerPrivateInterface methods + virtual void load(const WebCore::String& url); + virtual void cancelLoad(); + + virtual void play(); + virtual void pause(); + + virtual WebCore::IntSize naturalSize() const; + + virtual bool hasVideo() const; + + virtual void setVisible(bool); + + virtual float duration() const; + + virtual float currentTime() const; + virtual void seek(float time); + virtual bool seeking() const; + + virtual void setEndTime(float time); + + virtual void setRate(float); + virtual bool paused() const; + + virtual void setVolume(float); + + virtual WebCore::MediaPlayer::NetworkState networkState() const; + virtual WebCore::MediaPlayer::ReadyState readyState() const; + + virtual float maxTimeSeekable() const; + virtual float maxTimeBuffered() const; + + virtual int dataRate() const; + virtual void setAutobuffer(bool); + + virtual bool totalBytesKnown() const; + virtual unsigned totalBytes() const; + virtual unsigned bytesLoaded() const; + + virtual void setSize(const WebCore::IntSize&); + virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); + + private: + friend class WebCore::MediaPlayerPrivate; + + WebMediaPlayerClientImpl(); + + // Static methods used by WebKit for construction. + static WebCore::MediaPlayerPrivateInterface* create( + WebCore::MediaPlayer* player); + static void getSupportedTypes( + WTF::HashSet<WebCore::String>& supportedTypes); + static WebCore::MediaPlayer::SupportsType supportsType( + const WebCore::String& type, const WebCore::String& codecs); + + WebCore::MediaPlayer* m_mediaPlayer; + WebKit::WebMediaPlayer* m_webMediaPlayer; +}; + +#endif // ENABLE(VIDEO) + +#endif // WEBKIT_GLUE_WEBMEDIAPLAYERCLIENT_IMPL_H_ diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index dbaf3b8..193aef4 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -41,6 +41,8 @@ namespace WebKit { class WebDragData; class WebWorker; class WebWorkerClient; +class WebMediaPlayer; +class WebMediaPlayerClient; struct WebPoint; struct WebRect; } @@ -134,7 +136,8 @@ class WebViewDelegate : virtual public WebWidgetDelegate { } // Called when a WebMediaPlayerDelegate is needed. - virtual webkit_glue::WebMediaPlayerDelegate* CreateMediaPlayerDelegate() { + virtual WebKit::WebMediaPlayer* CreateWebMediaPlayer( + WebKit::WebMediaPlayerClient* client) { return NULL; } diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index e788218..a103ddd 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -4186,6 +4186,8 @@ '../third_party/WebKit/WebKit/chromium/public/WebInputEvent.h', '../third_party/WebKit/WebKit/chromium/public/WebKit.h', '../third_party/WebKit/WebKit/chromium/public/WebKitClient.h', + '../third_party/WebKit/WebKit/chromium/public/WebMediaPlayer.h', + '../third_party/WebKit/WebKit/chromium/public/WebMediaPlayerClient.h', '../third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h', '../third_party/WebKit/WebKit/chromium/public/WebPluginListBuilder.h', '../third_party/WebKit/WebKit/chromium/public/WebPoint.h', @@ -4516,10 +4518,8 @@ 'glue/webkit_glue.h', 'glue/webkitclient_impl.cc', 'glue/webkitclient_impl.h', - 'glue/webmediaplayer.h', - 'glue/webmediaplayer_delegate.h', - 'glue/webmediaplayer_impl.cc', - 'glue/webmediaplayer_impl.h', + 'glue/webmediaplayerclient_impl.cc', + 'glue/webmediaplayerclient_impl.h', 'glue/webmenurunner_mac.h', 'glue/webmenurunner_mac.mm', 'glue/webplugin.h', |