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

Side by Side Diff: content/renderer/render_view_impl.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 and resolving merge conflicts 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | media/base/android/cookie_getter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 #include "webkit/plugins/npapi/webplugin_impl.h" 197 #include "webkit/plugins/npapi/webplugin_impl.h"
198 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" 198 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
199 199
200 #if defined(OS_ANDROID) 200 #if defined(OS_ANDROID)
201 #include "content/common/android/device_info.h" 201 #include "content/common/android/device_info.h"
202 #include "content/renderer/android/address_detector.h" 202 #include "content/renderer/android/address_detector.h"
203 #include "content/renderer/android/content_detector.h" 203 #include "content/renderer/android/content_detector.h"
204 #include "content/renderer/android/email_detector.h" 204 #include "content/renderer/android/email_detector.h"
205 #include "content/renderer/android/phone_number_detector.h" 205 #include "content/renderer/android/phone_number_detector.h"
206 #include "content/renderer/media/stream_texture_factory_impl_android.h" 206 #include "content/renderer/media/stream_texture_factory_impl_android.h"
207 #include "content/renderer/media/webmediaplayer_proxy_impl_android.h"
207 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHitTestResult.h" 208 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHitTestResult.h"
208 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatPoin t.h" 209 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatPoin t.h"
209 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatRect .h" 210 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatRect .h"
210 #include "ui/gfx/rect_f.h" 211 #include "ui/gfx/rect_f.h"
212 #include "webkit/media/android/media_player_bridge_manager_impl.h"
211 #include "webkit/media/android/webmediaplayer_android.h" 213 #include "webkit/media/android/webmediaplayer_android.h"
214 #include "webkit/media/android/webmediaplayer_impl_android.h"
215 #include "webkit/media/android/webmediaplayer_in_process_android.h"
212 #include "webkit/media/android/webmediaplayer_manager_android.h" 216 #include "webkit/media/android/webmediaplayer_manager_android.h"
213 #elif defined(OS_WIN) 217 #elif defined(OS_WIN)
214 // TODO(port): these files are currently Windows only because they concern: 218 // TODO(port): these files are currently Windows only because they concern:
215 // * theming 219 // * theming
216 #include "ui/base/native_theme/native_theme_win.h" 220 #include "ui/base/native_theme/native_theme_win.h"
217 #elif defined(USE_X11) 221 #elif defined(USE_X11)
218 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme. h" 222 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebRenderTheme. h"
219 #include "ui/base/native_theme/native_theme.h" 223 #include "ui/base/native_theme/native_theme.h"
220 #elif defined(OS_MACOSX) 224 #elif defined(OS_MACOSX)
221 #include "skia/ext/skia_utils_mac.h" 225 #include "skia/ext/skia_utils_mac.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 device_orientation_dispatcher_(NULL), 609 device_orientation_dispatcher_(NULL),
606 media_stream_dispatcher_(NULL), 610 media_stream_dispatcher_(NULL),
607 media_stream_impl_(NULL), 611 media_stream_impl_(NULL),
608 devtools_agent_(NULL), 612 devtools_agent_(NULL),
609 accessibility_mode_(AccessibilityModeOff), 613 accessibility_mode_(AccessibilityModeOff),
610 renderer_accessibility_(NULL), 614 renderer_accessibility_(NULL),
611 java_bridge_dispatcher_(NULL), 615 java_bridge_dispatcher_(NULL),
612 mouse_lock_dispatcher_(NULL), 616 mouse_lock_dispatcher_(NULL),
613 #if defined(OS_ANDROID) 617 #if defined(OS_ANDROID)
614 expected_content_intent_id_(0), 618 expected_content_intent_id_(0),
619 media_player_proxy_(NULL),
615 #endif 620 #endif
616 session_storage_namespace_id_(session_storage_namespace_id), 621 session_storage_namespace_id_(session_storage_namespace_id),
617 handling_select_range_(false), 622 handling_select_range_(false),
618 #if defined(OS_WIN) 623 #if defined(OS_WIN)
619 focused_plugin_id_(-1), 624 focused_plugin_id_(-1),
620 #endif 625 #endif
621 guest_to_embedder_channel_(guest_to_embedder_channel), 626 guest_to_embedder_channel_(guest_to_embedder_channel),
622 guest_pp_instance_(0), 627 guest_pp_instance_(0),
623 guest_uninitialized_context_(NULL), 628 guest_uninitialized_context_(NULL),
624 updating_frame_tree_(false), 629 updating_frame_tree_(false),
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
2489 route_id, 2494 route_id,
2490 routing_id_); 2495 routing_id_);
2491 } 2496 }
2492 } 2497 }
2493 2498
2494 WebMediaPlayer* RenderViewImpl::createMediaPlayer( 2499 WebMediaPlayer* RenderViewImpl::createMediaPlayer(
2495 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { 2500 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) {
2496 FOR_EACH_OBSERVER( 2501 FOR_EACH_OBSERVER(
2497 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); 2502 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client));
2498 2503
2504 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
2499 #if defined(OS_ANDROID) 2505 #if defined(OS_ANDROID)
2500 // TODO(qinmin): upstream the implementation of getting WebGraphicsContext3D 2506 // TODO(qinmin): upstream the implementation of getting WebGraphicsContext3D
2501 // and GpuChannelHost here to replace the NULL params. 2507 // and GpuChannelHost here to replace the NULL params.
2502 return new webkit_media::WebMediaPlayerAndroid( 2508 if (cmd_line->HasSwitch(switches::kMediaPlayerInRenderProcess)) {
2503 frame, client, cookieJar(frame), media_player_manager_.get(), 2509 if (!media_bridge_manager_.get()) {
2504 new content::StreamTextureFactoryImpl(NULL, NULL, routing_id_)); 2510 media_bridge_manager_.reset(
2511 new webkit_media::MediaPlayerBridgeManagerImpl(1));
2512 }
2513 return new webkit_media::WebMediaPlayerInProcessAndroid(
2514 frame,
2515 client,
2516 cookieJar(frame),
2517 media_player_manager_.get(),
2518 media_bridge_manager_.get(),
2519 new content::StreamTextureFactoryImpl(
2520 NULL, NULL, routing_id_),
2521 cmd_line->HasSwitch(switches::kDisableMediaHistoryLogging));
2522 }
2523 if (!media_player_proxy_) {
2524 media_player_proxy_ = new content::WebMediaPlayerProxyImplAndroid(
2525 this, media_player_manager_.get());
2526 }
2527 return new webkit_media::WebMediaPlayerImplAndroid(
2528 frame,
2529 client,
2530 media_player_manager_.get(),
2531 media_player_proxy_,
2532 new content::StreamTextureFactoryImpl(
2533 NULL, NULL, routing_id_));
2505 #endif 2534 #endif
2506 2535
2507 media::MessageLoopFactory* message_loop_factory = 2536 media::MessageLoopFactory* message_loop_factory =
2508 new media::MessageLoopFactory(); 2537 new media::MessageLoopFactory();
2509 media::FilterCollection* collection = new media::FilterCollection(); 2538 media::FilterCollection* collection = new media::FilterCollection();
2510 RenderMediaLog* render_media_log = new RenderMediaLog(); 2539 RenderMediaLog* render_media_log = new RenderMediaLog();
2511 2540
2512 RenderAudioSourceProvider* audio_source_provider = NULL; 2541 RenderAudioSourceProvider* audio_source_provider = NULL;
2513 2542
2514 // Add in any custom filter factories first. 2543 // Add in any custom filter factories first.
2515 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
2516 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { 2544 if (!cmd_line->HasSwitch(switches::kDisableAudio)) {
2517 // audio_source_provider is a "provider" to WebKit, and a sink 2545 // audio_source_provider is a "provider" to WebKit, and a sink
2518 // from the perspective of the audio renderer. 2546 // from the perspective of the audio renderer.
2519 audio_source_provider = new RenderAudioSourceProvider(); 2547 audio_source_provider = new RenderAudioSourceProvider();
2520 2548
2521 // Add the chrome specific audio renderer, using audio_source_provider 2549 // Add the chrome specific audio renderer, using audio_source_provider
2522 // as the sink. 2550 // as the sink.
2523 media::AudioRendererImpl* audio_renderer = 2551 media::AudioRendererImpl* audio_renderer =
2524 new media::AudioRendererImpl(audio_source_provider); 2552 new media::AudioRendererImpl(audio_source_provider);
2525 collection->AddAudioRenderer(audio_renderer); 2553 collection->AddAudioRenderer(audio_renderer);
(...skipping 3623 matching lines...) Expand 10 before | Expand all | Expand 10 after
6149 6177
6150 updating_frame_tree_ = true; 6178 updating_frame_tree_ = true;
6151 active_frame_id_map_.clear(); 6179 active_frame_id_map_.clear();
6152 6180
6153 target_process_id_ = process_id; 6181 target_process_id_ = process_id;
6154 target_routing_id_ = route_id; 6182 target_routing_id_ = route_id;
6155 CreateFrameTree(webview()->mainFrame(), frames); 6183 CreateFrameTree(webview()->mainFrame(), frames);
6156 6184
6157 updating_frame_tree_ = false; 6185 updating_frame_tree_ = false;
6158 } 6186 }
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | media/base/android/cookie_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698