OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 #include "content/public/common/content_paths.h" | 41 #include "content/public/common/content_paths.h" |
42 #include "content/public/common/content_switches.h" | 42 #include "content/public/common/content_switches.h" |
43 #include "content/public/common/renderer_preferences.h" | 43 #include "content/public/common/renderer_preferences.h" |
44 #include "content/public/renderer/content_renderer_client.h" | 44 #include "content/public/renderer/content_renderer_client.h" |
45 #include "content/public/renderer/render_process_observer.h" | 45 #include "content/public/renderer/render_process_observer.h" |
46 #include "content/public/renderer/render_view_visitor.h" | 46 #include "content/public/renderer/render_view_visitor.h" |
47 #include "content/renderer/devtools_agent_filter.h" | 47 #include "content/renderer/devtools_agent_filter.h" |
48 #include "content/renderer/gpu/compositor_thread.h" | 48 #include "content/renderer/gpu/compositor_thread.h" |
49 #include "content/renderer/media/audio_input_message_filter.h" | 49 #include "content/renderer/media/audio_input_message_filter.h" |
50 #include "content/renderer/media/audio_message_filter.h" | 50 #include "content/renderer/media/audio_message_filter.h" |
51 #include "content/renderer/media/media_stream_center.h" | |
52 #include "content/renderer/media/video_capture_impl_manager.h" | 51 #include "content/renderer/media/video_capture_impl_manager.h" |
53 #include "content/renderer/media/video_capture_message_filter.h" | 52 #include "content/renderer/media/video_capture_message_filter.h" |
54 #include "content/renderer/plugin_channel_host.h" | 53 #include "content/renderer/plugin_channel_host.h" |
55 #include "content/renderer/render_process_impl.h" | 54 #include "content/renderer/render_process_impl.h" |
56 #include "content/renderer/render_view_impl.h" | 55 #include "content/renderer/render_view_impl.h" |
57 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 56 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
58 #include "grit/content_resources.h" | 57 #include "grit/content_resources.h" |
59 #include "ipc/ipc_channel_handle.h" | 58 #include "ipc/ipc_channel_handle.h" |
60 #include "ipc/ipc_platform_file.h" | 59 #include "ipc/ipc_platform_file.h" |
61 #include "media/base/media.h" | 60 #include "media/base/media.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 widget_count_ = 0; | 202 widget_count_ = 0; |
204 hidden_widget_count_ = 0; | 203 hidden_widget_count_ = 0; |
205 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; | 204 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; |
206 idle_notifications_to_skip_ = 0; | 205 idle_notifications_to_skip_ = 0; |
207 compositor_initialized_ = false; | 206 compositor_initialized_ = false; |
208 | 207 |
209 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); | 208 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); |
210 main_thread_indexed_db_dispatcher_.reset( | 209 main_thread_indexed_db_dispatcher_.reset( |
211 IndexedDBDispatcher::ThreadSpecificInstance()); | 210 IndexedDBDispatcher::ThreadSpecificInstance()); |
212 | 211 |
213 media_stream_center_ = NULL; | |
214 | |
215 db_message_filter_ = new DBMessageFilter(); | 212 db_message_filter_ = new DBMessageFilter(); |
216 AddFilter(db_message_filter_.get()); | 213 AddFilter(db_message_filter_.get()); |
217 | 214 |
218 vc_manager_ = new VideoCaptureImplManager(); | 215 vc_manager_ = new VideoCaptureImplManager(); |
219 AddFilter(vc_manager_->video_capture_message_filter()); | 216 AddFilter(vc_manager_->video_capture_message_filter()); |
220 | 217 |
221 audio_input_message_filter_ = new AudioInputMessageFilter(); | 218 audio_input_message_filter_ = new AudioInputMessageFilter(); |
222 AddFilter(audio_input_message_filter_.get()); | 219 AddFilter(audio_input_message_filter_.get()); |
223 | 220 |
224 audio_message_filter_ = new AudioMessageFilter(); | 221 audio_message_filter_ = new AudioMessageFilter(); |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 gpu_channel_ = new GpuChannelHost(this, client_id); | 917 gpu_channel_ = new GpuChannelHost(this, client_id); |
921 gpu_channel_->set_gpu_info(gpu_info); | 918 gpu_channel_->set_gpu_info(gpu_info); |
922 content::GetContentClient()->SetGpuInfo(gpu_info); | 919 content::GetContentClient()->SetGpuInfo(gpu_info); |
923 | 920 |
924 // Connect to the GPU process if a channel name was received. | 921 // Connect to the GPU process if a channel name was received. |
925 gpu_channel_->Connect(channel_handle, renderer_process_for_gpu); | 922 gpu_channel_->Connect(channel_handle, renderer_process_for_gpu); |
926 | 923 |
927 return GetGpuChannel(); | 924 return GetGpuChannel(); |
928 } | 925 } |
929 | 926 |
930 WebKit::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( | |
931 WebKit::WebMediaStreamCenterClient* client) { | |
932 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
933 switches::kEnableMediaStream)) { | |
934 return NULL; | |
935 } | |
936 if (!media_stream_center_) | |
937 media_stream_center_ = new content::MediaStreamCenter(client); | |
938 return media_stream_center_; | |
939 } | |
940 | |
941 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 927 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
942 if (!gpu_channel_.get()) | 928 if (!gpu_channel_.get()) |
943 return NULL; | 929 return NULL; |
944 | 930 |
945 if (gpu_channel_->state() != GpuChannelHost::kConnected) | 931 if (gpu_channel_->state() != GpuChannelHost::kConnected) |
946 return NULL; | 932 return NULL; |
947 | 933 |
948 return gpu_channel_.get(); | 934 return gpu_channel_.get(); |
949 } | 935 } |
950 | 936 |
(...skipping 22 matching lines...) Expand all Loading... |
973 | 959 |
974 scoped_refptr<base::MessageLoopProxy> | 960 scoped_refptr<base::MessageLoopProxy> |
975 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 961 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
976 DCHECK(message_loop() == MessageLoop::current()); | 962 DCHECK(message_loop() == MessageLoop::current()); |
977 if (!file_thread_.get()) { | 963 if (!file_thread_.get()) { |
978 file_thread_.reset(new base::Thread("Renderer::FILE")); | 964 file_thread_.reset(new base::Thread("Renderer::FILE")); |
979 file_thread_->Start(); | 965 file_thread_->Start(); |
980 } | 966 } |
981 return file_thread_->message_loop_proxy(); | 967 return file_thread_->message_loop_proxy(); |
982 } | 968 } |
OLD | NEW |