Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: webkit/support/webkit_support.cc

Issue 10919075: Move android mediaplayer from render process to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/support/webkit_support.h" 5 #include "webkit/support/webkit_support.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "webkit/appcache/web_application_cache_host_impl.h" 51 #include "webkit/appcache/web_application_cache_host_impl.h"
52 #include "webkit/fileapi/isolated_context.h" 52 #include "webkit/fileapi/isolated_context.h"
53 #include "webkit/glue/user_agent.h" 53 #include "webkit/glue/user_agent.h"
54 #include "webkit/glue/webkit_constants.h" 54 #include "webkit/glue/webkit_constants.h"
55 #include "webkit/glue/webkit_glue.h" 55 #include "webkit/glue/webkit_glue.h"
56 #include "webkit/glue/webkitplatformsupport_impl.h" 56 #include "webkit/glue/webkitplatformsupport_impl.h"
57 #include "webkit/glue/weburlrequest_extradata_impl.h" 57 #include "webkit/glue/weburlrequest_extradata_impl.h"
58 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" 58 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
59 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" 59 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
60 #if defined(OS_ANDROID) 60 #if defined(OS_ANDROID)
61 #include "webkit/media/android/webmediaplayer_android.h" 61 #include "webkit/media/android/media_player_bridge_manager_impl.h"
62 #include "webkit/media/android/webmediaplayer_in_process_android.h"
62 #include "webkit/media/android/webmediaplayer_manager_android.h" 63 #include "webkit/media/android/webmediaplayer_manager_android.h"
63 #endif 64 #endif
64 #include "webkit/media/webmediaplayer_impl.h" 65 #include "webkit/media/webmediaplayer_impl.h"
65 #include "webkit/plugins/npapi/plugin_list.h" 66 #include "webkit/plugins/npapi/plugin_list.h"
66 #include "webkit/plugins/npapi/webplugin_impl.h" 67 #include "webkit/plugins/npapi/webplugin_impl.h"
67 #include "webkit/plugins/npapi/webplugin_page_delegate.h" 68 #include "webkit/plugins/npapi/webplugin_page_delegate.h"
68 #include "webkit/plugins/webplugininfo.h" 69 #include "webkit/plugins/webplugininfo.h"
69 #include "webkit/support/platform_support.h" 70 #include "webkit/support/platform_support.h"
70 #include "webkit/support/simple_database_system.h" 71 #include "webkit/support/simple_database_system.h"
71 #include "webkit/support/test_webkit_platform_support.h" 72 #include "webkit/support/test_webkit_platform_support.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 InitLogging(); 160 InitLogging();
160 } 161 }
161 main_message_loop_.reset(new MessageLoopType); 162 main_message_loop_.reset(new MessageLoopType);
162 163
163 // TestWebKitPlatformSupport must be instantiated after MessageLoopType. 164 // TestWebKitPlatformSupport must be instantiated after MessageLoopType.
164 webkit_platform_support_.reset( 165 webkit_platform_support_.reset(
165 new TestWebKitPlatformSupport(unit_test_mode, 166 new TestWebKitPlatformSupport(unit_test_mode,
166 shadow_platform_delegate)); 167 shadow_platform_delegate));
167 168
168 #if defined(OS_ANDROID) 169 #if defined(OS_ANDROID)
170 // Make sure we have enough decoding resources for layout tests.
171 // The current maximum number of media elements in a layout test is 8.
172 media_bridge_manager_.reset(
173 new webkit_media::MediaPlayerBridgeManagerImpl(8));
169 media_player_manager_.reset( 174 media_player_manager_.reset(
170 new webkit_media::WebMediaPlayerManagerAndroid()); 175 new webkit_media::WebMediaPlayerManagerAndroid());
171 #endif 176 #endif
172 } 177 }
173 178
174 ~TestEnvironment() { 179 ~TestEnvironment() {
175 SimpleResourceLoaderBridge::Shutdown(); 180 SimpleResourceLoaderBridge::Shutdown();
176 } 181 }
177 182
178 TestWebKitPlatformSupport* webkit_platform_support() const { 183 TestWebKitPlatformSupport* webkit_platform_support() const {
(...skipping 20 matching lines...) Expand all
199 mock_current_directory_ = directory; 204 mock_current_directory_ = directory;
200 } 205 }
201 206
202 FilePath mock_current_directory() const { 207 FilePath mock_current_directory() const {
203 return mock_current_directory_; 208 return mock_current_directory_;
204 } 209 }
205 210
206 webkit_media::WebMediaPlayerManagerAndroid* media_player_manager() { 211 webkit_media::WebMediaPlayerManagerAndroid* media_player_manager() {
207 return media_player_manager_.get(); 212 return media_player_manager_.get();
208 } 213 }
214
215 webkit_media::MediaPlayerBridgeManagerImpl* media_bridge_manager() {
216 return media_bridge_manager_.get();
217 }
209 #endif 218 #endif
210 219
211 private: 220 private:
212 // Data member at_exit_manager_ will take the ownership of the input 221 // Data member at_exit_manager_ will take the ownership of the input
213 // AtExitManager and manage its lifecycle. 222 // AtExitManager and manage its lifecycle.
214 scoped_ptr<base::AtExitManager> at_exit_manager_; 223 scoped_ptr<base::AtExitManager> at_exit_manager_;
215 scoped_ptr<MessageLoopType> main_message_loop_; 224 scoped_ptr<MessageLoopType> main_message_loop_;
216 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_; 225 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_;
217 226
218 #if defined(OS_ANDROID) 227 #if defined(OS_ANDROID)
219 FilePath mock_current_directory_; 228 FilePath mock_current_directory_;
220 scoped_ptr<webkit_media::WebMediaPlayerManagerAndroid> media_player_manager_; 229 scoped_ptr<webkit_media::WebMediaPlayerManagerAndroid> media_player_manager_;
230 scoped_ptr<webkit_media::MediaPlayerBridgeManagerImpl> media_bridge_manager_;
221 #endif 231 #endif
222 }; 232 };
223 233
224 class WebPluginImplWithPageDelegate 234 class WebPluginImplWithPageDelegate
225 : public webkit_support::TestWebPluginPageDelegate, 235 : public webkit_support::TestWebPluginPageDelegate,
226 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>, 236 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>,
227 public webkit::npapi::WebPluginImpl { 237 public webkit::npapi::WebPluginImpl {
228 public: 238 public:
229 WebPluginImplWithPageDelegate(WebFrame* frame, 239 WebPluginImplWithPageDelegate(WebFrame* frame,
230 const WebPluginParams& params, 240 const WebPluginParams& params,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 return new WebPluginImplWithPageDelegate( 390 return new WebPluginImplWithPageDelegate(
381 frame, new_params, plugins.front().path); 391 frame, new_params, plugins.front().path);
382 } 392 }
383 393
384 WebKit::WebMediaPlayer* CreateMediaPlayer( 394 WebKit::WebMediaPlayer* CreateMediaPlayer(
385 WebFrame* frame, 395 WebFrame* frame,
386 const WebURL& url, 396 const WebURL& url,
387 WebMediaPlayerClient* client, 397 WebMediaPlayerClient* client,
388 webkit_media::MediaStreamClient* media_stream_client) { 398 webkit_media::MediaStreamClient* media_stream_client) {
389 #if defined(OS_ANDROID) 399 #if defined(OS_ANDROID)
390 return new webkit_media::WebMediaPlayerAndroid( 400 return new webkit_media::WebMediaPlayerInProcessAndroid(
391 frame, 401 frame,
392 client, 402 client,
393 GetWebKitPlatformSupport()->cookieJar(), 403 GetWebKitPlatformSupport()->cookieJar(),
394 test_environment->media_player_manager(), 404 test_environment->media_player_manager(),
395 new webkit_support::TestStreamTextureFactory()); 405 test_environment->media_bridge_manager(),
406 new webkit_support::TestStreamTextureFactory(),
407 true);
396 #else 408 #else
397 scoped_ptr<media::MessageLoopFactory> message_loop_factory( 409 scoped_ptr<media::MessageLoopFactory> message_loop_factory(
398 new media::MessageLoopFactory()); 410 new media::MessageLoopFactory());
399 411
400 scoped_ptr<media::FilterCollection> collection( 412 scoped_ptr<media::FilterCollection> collection(
401 new media::FilterCollection()); 413 new media::FilterCollection());
402 414
403 return new webkit_media::WebMediaPlayerImpl( 415 return new webkit_media::WebMediaPlayerImpl(
404 frame, 416 frame,
405 client, 417 client,
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 // Logging 853 // Logging
842 void EnableWebCoreLogChannels(const std::string& channels) { 854 void EnableWebCoreLogChannels(const std::string& channels) {
843 webkit_glue::EnableWebCoreLogChannels(channels); 855 webkit_glue::EnableWebCoreLogChannels(channels);
844 } 856 }
845 857
846 void SetGamepadData(const WebKit::WebGamepads& pads) { 858 void SetGamepadData(const WebKit::WebGamepads& pads) {
847 test_environment->webkit_platform_support()->setGamepadData(pads); 859 test_environment->webkit_platform_support()->setGamepadData(pads);
848 } 860 }
849 861
850 } // namespace webkit_support 862 } // namespace webkit_support
OLDNEW
« content/renderer/render_view_impl.h ('K') | « webkit/support/platform_support_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698