diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-13 03:49:25 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-13 03:49:25 +0000 |
commit | da952fdc5f0de04fba3add0bd90a9c7ca7c02afb (patch) | |
tree | c0eb59700cc8f45633ca971c824177ea17f5e466 /content | |
parent | 9a142c10e11ffcb972b3ec969c8d2b95939cfb02 (diff) | |
download | chromium_src-da952fdc5f0de04fba3add0bd90a9c7ca7c02afb.zip chromium_src-da952fdc5f0de04fba3add0bd90a9c7ca7c02afb.tar.gz chromium_src-da952fdc5f0de04fba3add0bd90a9c7ca7c02afb.tar.bz2 |
Fold WebMediaPlayerImpl::Initialize() into the constructor.
OverrideCreateWebMediaPlayer() was simplified to return a pointer instead of relying on a bool+out-param since unlike OverrideCreatePlugin() we don't require blocking creation of media players.
BUG=109958
Review URL: http://codereview.chromium.org/9187045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117607 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/public/renderer/content_renderer_client.h | 13 | ||||
-rw-r--r-- | content/renderer/mock_content_renderer_client.cc | 11 | ||||
-rw-r--r-- | content/renderer/mock_content_renderer_client.h | 8 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 14 | ||||
-rw-r--r-- | content/shell/shell_content_renderer_client.cc | 11 | ||||
-rw-r--r-- | content/shell/shell_content_renderer_client.h | 8 |
6 files changed, 32 insertions, 33 deletions
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index 279d65b..7a9d7cd 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -104,19 +104,18 @@ class ContentRendererClient { std::string* error_html, string16* error_description) = 0; - // Allows embedder to override creating a WebMediaPlayer. If it returns - // true, then |player| will contain the created player. Else the content - // layer should create the media player. - virtual bool OverrideCreateWebMediaPlayer( + // Allows embedder to override creating a WebMediaPlayerImpl. If it returns + // NULL the content layer will create the media player. + virtual webkit_media::WebMediaPlayerImpl* OverrideCreateWebMediaPlayer( RenderView* render_view, + WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client, base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, - media::MediaLog* media_log, - webkit_media::WebMediaPlayerImpl** player) = 0; + media::MediaLog* media_log) = 0; // Returns true if the renderer process should schedule the idle handler when // all widgets are hidden. diff --git a/content/renderer/mock_content_renderer_client.cc b/content/renderer/mock_content_renderer_client.cc index 5a50a0e..fe811cc 100644 --- a/content/renderer/mock_content_renderer_client.cc +++ b/content/renderer/mock_content_renderer_client.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -42,17 +42,18 @@ bool MockContentRendererClient::HasErrorPage(int http_status_code, return false; } -bool MockContentRendererClient::OverrideCreateWebMediaPlayer( +webkit_media::WebMediaPlayerImpl* +MockContentRendererClient::OverrideCreateWebMediaPlayer( RenderView* render_view, + WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client, base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, - media::MediaLog* media_log, - webkit_media::WebMediaPlayerImpl** player) { - return false; + media::MediaLog* media_log) { + return NULL; } void MockContentRendererClient::GetNavigationErrorStrings( diff --git a/content/renderer/mock_content_renderer_client.h b/content/renderer/mock_content_renderer_client.h index 7bd1c33..af62886 100644 --- a/content/renderer/mock_content_renderer_client.h +++ b/content/renderer/mock_content_renderer_client.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -34,16 +34,16 @@ class MockContentRendererClient : public ContentRendererClient { const WebKit::WebURLError& error, std::string* error_html, string16* error_description) OVERRIDE; - virtual bool OverrideCreateWebMediaPlayer( + virtual webkit_media::WebMediaPlayerImpl* OverrideCreateWebMediaPlayer( RenderView* render_view, + WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client, base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, - media::MediaLog* media_log, - webkit_media::WebMediaPlayerImpl** player) OVERRIDE; + media::MediaLog* media_log) OVERRIDE; virtual bool RunIdleHandlerWhenWidgetsHidden() OVERRIDE; virtual bool AllowPopup(const GURL& creator) OVERRIDE; virtual bool ShouldFork(WebKit::WebFrame* frame, diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index c5f1fc6..12a5ac7 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -1985,17 +1985,15 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer( } #endif - webkit_media::WebMediaPlayerImpl* media_player = NULL; - if (!content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( - this, client, AsWeakPtr(), collection, audio_source_provider, - message_loop_factory, media_stream_impl_.get(), render_media_log, - &media_player)) { + webkit_media::WebMediaPlayerImpl* media_player = + content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( + this, frame, client, AsWeakPtr(), collection, audio_source_provider, + message_loop_factory, media_stream_impl_.get(), render_media_log); + if (!media_player) { media_player = new webkit_media::WebMediaPlayerImpl( - client, AsWeakPtr(), collection, audio_source_provider, + frame, client, AsWeakPtr(), collection, audio_source_provider, message_loop_factory, media_stream_impl_.get(), render_media_log); } - - media_player->Initialize(frame); return media_player; } diff --git a/content/shell/shell_content_renderer_client.cc b/content/shell/shell_content_renderer_client.cc index ddf3c44..b1f0d41 100644 --- a/content/shell/shell_content_renderer_client.cc +++ b/content/shell/shell_content_renderer_client.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -48,17 +48,18 @@ void ShellContentRendererClient::GetNavigationErrorStrings( string16* error_description) { } -bool ShellContentRendererClient::OverrideCreateWebMediaPlayer( +webkit_media::WebMediaPlayerImpl* +ShellContentRendererClient::OverrideCreateWebMediaPlayer( RenderView* render_view, + WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client, base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, - media::MediaLog* media_log, - webkit_media::WebMediaPlayerImpl** player) { - return false; + media::MediaLog* media_log) { + return NULL; } bool ShellContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { diff --git a/content/shell/shell_content_renderer_client.h b/content/shell/shell_content_renderer_client.h index e0cdc87..eed6d0b 100644 --- a/content/shell/shell_content_renderer_client.h +++ b/content/shell/shell_content_renderer_client.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -31,16 +31,16 @@ class ShellContentRendererClient : public ContentRendererClient { const WebKit::WebURLError& error, std::string* error_html, string16* error_description) OVERRIDE; - virtual bool OverrideCreateWebMediaPlayer( + virtual webkit_media::WebMediaPlayerImpl* OverrideCreateWebMediaPlayer( RenderView* render_view, + WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client, base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, media::FilterCollection* collection, WebKit::WebAudioSourceProvider* audio_source_provider, media::MessageLoopFactory* message_loop_factory, webkit_media::MediaStreamClient* media_stream_client, - media::MediaLog* media_log, - webkit_media::WebMediaPlayerImpl** player) OVERRIDE; + media::MediaLog* media_log) OVERRIDE; virtual bool RunIdleHandlerWhenWidgetsHidden() OVERRIDE; virtual bool AllowPopup(const GURL& creator) OVERRIDE; virtual bool ShouldFork(WebKit::WebFrame* frame, |