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

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 media_bridge_manager_.reset(
171 new webkit_media::MediaPlayerBridgeManagerImpl(8));
169 media_player_manager_.reset( 172 media_player_manager_.reset(
170 new webkit_media::WebMediaPlayerManagerAndroid()); 173 new webkit_media::WebMediaPlayerManagerAndroid());
171 #endif 174 #endif
172 } 175 }
173 176
174 ~TestEnvironment() { 177 ~TestEnvironment() {
175 SimpleResourceLoaderBridge::Shutdown(); 178 SimpleResourceLoaderBridge::Shutdown();
176 } 179 }
177 180
178 TestWebKitPlatformSupport* webkit_platform_support() const { 181 TestWebKitPlatformSupport* webkit_platform_support() const {
(...skipping 20 matching lines...) Expand all
199 mock_current_directory_ = directory; 202 mock_current_directory_ = directory;
200 } 203 }
201 204
202 FilePath mock_current_directory() const { 205 FilePath mock_current_directory() const {
203 return mock_current_directory_; 206 return mock_current_directory_;
204 } 207 }
205 208
206 webkit_media::WebMediaPlayerManagerAndroid* media_player_manager() { 209 webkit_media::WebMediaPlayerManagerAndroid* media_player_manager() {
207 return media_player_manager_.get(); 210 return media_player_manager_.get();
208 } 211 }
212
213 webkit_media::MediaPlayerBridgeManagerImpl* media_bridge_manager() {
214 return media_bridge_manager_.get();
215 }
209 #endif 216 #endif
210 217
211 private: 218 private:
212 // Data member at_exit_manager_ will take the ownership of the input 219 // Data member at_exit_manager_ will take the ownership of the input
213 // AtExitManager and manage its lifecycle. 220 // AtExitManager and manage its lifecycle.
214 scoped_ptr<base::AtExitManager> at_exit_manager_; 221 scoped_ptr<base::AtExitManager> at_exit_manager_;
215 scoped_ptr<MessageLoopType> main_message_loop_; 222 scoped_ptr<MessageLoopType> main_message_loop_;
216 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_; 223 scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_;
217 224
218 #if defined(OS_ANDROID) 225 #if defined(OS_ANDROID)
219 FilePath mock_current_directory_; 226 FilePath mock_current_directory_;
220 scoped_ptr<webkit_media::WebMediaPlayerManagerAndroid> media_player_manager_; 227 scoped_ptr<webkit_media::WebMediaPlayerManagerAndroid> media_player_manager_;
228 scoped_ptr<webkit_media::MediaPlayerBridgeManagerImpl> media_bridge_manager_;
221 #endif 229 #endif
222 }; 230 };
223 231
224 class WebPluginImplWithPageDelegate 232 class WebPluginImplWithPageDelegate
225 : public webkit_support::TestWebPluginPageDelegate, 233 : public webkit_support::TestWebPluginPageDelegate,
226 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>, 234 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>,
227 public webkit::npapi::WebPluginImpl { 235 public webkit::npapi::WebPluginImpl {
228 public: 236 public:
229 WebPluginImplWithPageDelegate(WebFrame* frame, 237 WebPluginImplWithPageDelegate(WebFrame* frame,
230 const WebPluginParams& params, 238 const WebPluginParams& params,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 return new WebPluginImplWithPageDelegate( 388 return new WebPluginImplWithPageDelegate(
381 frame, new_params, plugins.front().path); 389 frame, new_params, plugins.front().path);
382 } 390 }
383 391
384 WebKit::WebMediaPlayer* CreateMediaPlayer( 392 WebKit::WebMediaPlayer* CreateMediaPlayer(
385 WebFrame* frame, 393 WebFrame* frame,
386 const WebURL& url, 394 const WebURL& url,
387 WebMediaPlayerClient* client, 395 WebMediaPlayerClient* client,
388 webkit_media::MediaStreamClient* media_stream_client) { 396 webkit_media::MediaStreamClient* media_stream_client) {
389 #if defined(OS_ANDROID) 397 #if defined(OS_ANDROID)
390 return new webkit_media::WebMediaPlayerAndroid( 398 return new webkit_media::WebMediaPlayerInProcessAndroid(
391 frame, 399 frame,
392 client, 400 client,
393 GetWebKitPlatformSupport()->cookieJar(), 401 GetWebKitPlatformSupport()->cookieJar(),
394 test_environment->media_player_manager(), 402 test_environment->media_player_manager(),
395 new webkit_support::TestStreamTextureFactory()); 403 test_environment->media_bridge_manager(),
404 new webkit_support::TestStreamTextureFactory(),
405 true);
396 #else 406 #else
397 scoped_ptr<media::MessageLoopFactory> message_loop_factory( 407 scoped_ptr<media::MessageLoopFactory> message_loop_factory(
398 new media::MessageLoopFactory()); 408 new media::MessageLoopFactory());
399 409
400 scoped_ptr<media::FilterCollection> collection( 410 scoped_ptr<media::FilterCollection> collection(
401 new media::FilterCollection()); 411 new media::FilterCollection());
402 412
403 return new webkit_media::WebMediaPlayerImpl( 413 return new webkit_media::WebMediaPlayerImpl(
404 frame, 414 frame,
405 client, 415 client,
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 // Logging 851 // Logging
842 void EnableWebCoreLogChannels(const std::string& channels) { 852 void EnableWebCoreLogChannels(const std::string& channels) {
843 webkit_glue::EnableWebCoreLogChannels(channels); 853 webkit_glue::EnableWebCoreLogChannels(channels);
844 } 854 }
845 855
846 void SetGamepadData(const WebKit::WebGamepads& pads) { 856 void SetGamepadData(const WebKit::WebGamepads& pads) {
847 test_environment->webkit_platform_support()->setGamepadData(pads); 857 test_environment->webkit_platform_support()->setGamepadData(pads);
848 } 858 }
849 859
850 } // namespace webkit_support 860 } // namespace webkit_support
OLDNEW
« media/base/android/cookies_retriever.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