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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 19534002: Make RendererGpuVideoDecoderFactories live on arbitrary threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 7 years, 5 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
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_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "content/renderer/gpu/gpu_benchmarking_extension.h" 62 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
63 #include "content/renderer/gpu/input_event_filter.h" 63 #include "content/renderer/gpu/input_event_filter.h"
64 #include "content/renderer/gpu/input_handler_manager.h" 64 #include "content/renderer/gpu/input_handler_manager.h"
65 #include "content/renderer/media/audio_input_message_filter.h" 65 #include "content/renderer/media/audio_input_message_filter.h"
66 #include "content/renderer/media/audio_message_filter.h" 66 #include "content/renderer/media/audio_message_filter.h"
67 #include "content/renderer/media/audio_renderer_mixer_manager.h" 67 #include "content/renderer/media/audio_renderer_mixer_manager.h"
68 #include "content/renderer/media/media_stream_center.h" 68 #include "content/renderer/media/media_stream_center.h"
69 #include "content/renderer/media/media_stream_dependency_factory.h" 69 #include "content/renderer/media/media_stream_dependency_factory.h"
70 #include "content/renderer/media/midi_message_filter.h" 70 #include "content/renderer/media/midi_message_filter.h"
71 #include "content/renderer/media/peer_connection_tracker.h" 71 #include "content/renderer/media/peer_connection_tracker.h"
72 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
73 #include "content/renderer/media/video_capture_impl_manager.h" 72 #include "content/renderer/media/video_capture_impl_manager.h"
74 #include "content/renderer/media/video_capture_message_filter.h" 73 #include "content/renderer/media/video_capture_message_filter.h"
75 #include "content/renderer/memory_benchmarking_extension.h" 74 #include "content/renderer/memory_benchmarking_extension.h"
76 #include "content/renderer/p2p/socket_dispatcher.h" 75 #include "content/renderer/p2p/socket_dispatcher.h"
77 #include "content/renderer/plugin_channel_host.h" 76 #include "content/renderer/plugin_channel_host.h"
78 #include "content/renderer/render_process_impl.h" 77 #include "content/renderer/render_process_impl.h"
79 #include "content/renderer/render_process_visibility_manager.h" 78 #include "content/renderer/render_process_visibility_manager.h"
80 #include "content/renderer/render_view_impl.h" 79 #include "content/renderer/render_view_impl.h"
81 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 80 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
82 #include "content/renderer/skia_benchmarking_extension.h" 81 #include "content/renderer/skia_benchmarking_extension.h"
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) { 878 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) {
880 bool result = false; 879 bool result = false;
881 Send(new ViewHostMsg_ResolveProxy(url, &result, proxy_list)); 880 Send(new ViewHostMsg_ResolveProxy(url, &result, proxy_list));
882 return result; 881 return result;
883 } 882 }
884 883
885 void RenderThreadImpl::PostponeIdleNotification() { 884 void RenderThreadImpl::PostponeIdleNotification() {
886 idle_notifications_to_skip_ = 2; 885 idle_notifications_to_skip_ = 2;
887 } 886 }
888 887
889 scoped_refptr<media::GpuVideoDecoder::Factories> 888 scoped_refptr<content::RendererGpuVideoDecoderFactories>
scherkus (not reviewing) 2013/07/19 18:13:58 don't need content namespace
wuchengli 2013/07/20 06:04:14 Changed back to media::GpuVideoDecoder::Factories.
890 RenderThreadImpl::GetGpuFactories() { 889 RenderThreadImpl::GetGpuFactories(
890 scoped_refptr<base::MessageLoopProxy> factories_loop) {
891 DCHECK(IsMainThread()); 891 DCHECK(IsMainThread());
892 892
893 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 893 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
894 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories; 894 scoped_refptr<content::RendererGpuVideoDecoderFactories> gpu_factories;
scherkus (not reviewing) 2013/07/19 18:13:58 you don't need content namespace
wuchengli 2013/07/20 06:04:14 Changed back to media::GpuVideoDecoder::Factories.
895 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; 895 WebGraphicsContext3DCommandBufferImpl* context3d = NULL;
896 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) 896 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
897 context3d = GetGpuVDAContext3D(); 897 context3d = GetGpuVDAContext3D();
898 if (context3d) { 898 if (context3d) {
899 scoped_refptr<base::MessageLoopProxy> factories_loop =
900 compositor_message_loop_proxy();
901 if (!factories_loop.get())
902 factories_loop = base::MessageLoopProxy::current();
903 GpuChannelHost* gpu_channel_host = GetGpuChannel(); 899 GpuChannelHost* gpu_channel_host = GetGpuChannel();
904 if (gpu_channel_host) { 900 if (gpu_channel_host) {
905 gpu_factories = new RendererGpuVideoDecoderFactories( 901 gpu_factories = new RendererGpuVideoDecoderFactories(
906 gpu_channel_host, factories_loop, context3d); 902 gpu_channel_host, factories_loop, context3d);
907 } 903 }
908 } 904 }
909 return gpu_factories; 905 return gpu_factories;
910 } 906 }
911 907
912 /* static */ 908 /* static */
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 } 1209 }
1214 #endif 1210 #endif
1215 return media_stream_center_; 1211 return media_stream_center_;
1216 } 1212 }
1217 1213
1218 MediaStreamDependencyFactory* 1214 MediaStreamDependencyFactory*
1219 RenderThreadImpl::GetMediaStreamDependencyFactory() { 1215 RenderThreadImpl::GetMediaStreamDependencyFactory() {
1220 #if defined(ENABLE_WEBRTC) 1216 #if defined(ENABLE_WEBRTC)
1221 if (!media_stream_factory_) { 1217 if (!media_stream_factory_) {
1222 media_stream_factory_.reset(new MediaStreamDependencyFactory( 1218 media_stream_factory_.reset(new MediaStreamDependencyFactory(
1223 vc_manager_.get(), p2p_socket_dispatcher_.get())); 1219 vc_manager_.get(), p2p_socket_dispatcher_.get(),
1220 GetMediaThreadMessageLoopProxy()));
1224 } 1221 }
1225 #endif 1222 #endif
1226 return media_stream_factory_.get(); 1223 return media_stream_factory_.get();
1227 } 1224 }
1228 1225
1229 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { 1226 GpuChannelHost* RenderThreadImpl::GetGpuChannel() {
1230 if (!gpu_channel_.get()) 1227 if (!gpu_channel_.get())
1231 return NULL; 1228 return NULL;
1232 1229
1233 if (gpu_channel_->IsLost()) 1230 if (gpu_channel_->IsLost())
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 1297
1301 void RenderThreadImpl::SetFlingCurveParameters( 1298 void RenderThreadImpl::SetFlingCurveParameters(
1302 const std::vector<float>& new_touchpad, 1299 const std::vector<float>& new_touchpad,
1303 const std::vector<float>& new_touchscreen) { 1300 const std::vector<float>& new_touchscreen) {
1304 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, 1301 webkit_platform_support_->SetFlingCurveParameters(new_touchpad,
1305 new_touchscreen); 1302 new_touchscreen);
1306 1303
1307 } 1304 }
1308 1305
1309 } // namespace content 1306 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698