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

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

Issue 9619006: Adding a skeleton MediaStreamCenter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 "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 28 matching lines...) Expand all
39 #include "content/common/web_database_observer_impl.h" 39 #include "content/common/web_database_observer_impl.h"
40 #include "content/public/common/content_switches.h" 40 #include "content/public/common/content_switches.h"
41 #include "content/public/common/renderer_preferences.h" 41 #include "content/public/common/renderer_preferences.h"
42 #include "content/public/renderer/content_renderer_client.h" 42 #include "content/public/renderer/content_renderer_client.h"
43 #include "content/public/renderer/render_process_observer.h" 43 #include "content/public/renderer/render_process_observer.h"
44 #include "content/public/renderer/render_view_visitor.h" 44 #include "content/public/renderer/render_view_visitor.h"
45 #include "content/renderer/devtools_agent_filter.h" 45 #include "content/renderer/devtools_agent_filter.h"
46 #include "content/renderer/gpu/compositor_thread.h" 46 #include "content/renderer/gpu/compositor_thread.h"
47 #include "content/renderer/media/audio_input_message_filter.h" 47 #include "content/renderer/media/audio_input_message_filter.h"
48 #include "content/renderer/media/audio_message_filter.h" 48 #include "content/renderer/media/audio_message_filter.h"
49 #include "content/renderer/media/media_stream_center.h"
49 #include "content/renderer/media/video_capture_impl_manager.h" 50 #include "content/renderer/media/video_capture_impl_manager.h"
50 #include "content/renderer/media/video_capture_message_filter.h" 51 #include "content/renderer/media/video_capture_message_filter.h"
51 #include "content/renderer/plugin_channel_host.h" 52 #include "content/renderer/plugin_channel_host.h"
52 #include "content/renderer/render_process_impl.h" 53 #include "content/renderer/render_process_impl.h"
53 #include "content/renderer/render_view_impl.h" 54 #include "content/renderer/render_view_impl.h"
54 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 55 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
55 #include "grit/content_resources.h" 56 #include "grit/content_resources.h"
56 #include "ipc/ipc_channel_handle.h" 57 #include "ipc/ipc_channel_handle.h"
57 #include "ipc/ipc_platform_file.h" 58 #include "ipc/ipc_platform_file.h"
58 #include "net/base/net_errors.h" 59 #include "net/base/net_errors.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 widget_count_ = 0; 200 widget_count_ = 0;
200 hidden_widget_count_ = 0; 201 hidden_widget_count_ = 0;
201 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; 202 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs;
202 idle_notifications_to_skip_ = 0; 203 idle_notifications_to_skip_ = 0;
203 compositor_initialized_ = false; 204 compositor_initialized_ = false;
204 205
205 appcache_dispatcher_.reset(new AppCacheDispatcher(Get())); 206 appcache_dispatcher_.reset(new AppCacheDispatcher(Get()));
206 main_thread_indexed_db_dispatcher_.reset( 207 main_thread_indexed_db_dispatcher_.reset(
207 IndexedDBDispatcher::ThreadSpecificInstance()); 208 IndexedDBDispatcher::ThreadSpecificInstance());
208 209
210 media_stream_center_ = NULL;
211
209 db_message_filter_ = new DBMessageFilter(); 212 db_message_filter_ = new DBMessageFilter();
210 AddFilter(db_message_filter_.get()); 213 AddFilter(db_message_filter_.get());
211 214
212 vc_manager_ = new VideoCaptureImplManager(); 215 vc_manager_ = new VideoCaptureImplManager();
213 AddFilter(vc_manager_->video_capture_message_filter()); 216 AddFilter(vc_manager_->video_capture_message_filter());
214 217
215 audio_input_message_filter_ = new AudioInputMessageFilter(); 218 audio_input_message_filter_ = new AudioInputMessageFilter();
216 AddFilter(audio_input_message_filter_.get()); 219 AddFilter(audio_input_message_filter_.get());
217 220
218 audio_message_filter_ = new AudioMessageFilter(); 221 audio_message_filter_ = new AudioMessageFilter();
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 gpu_channel_ = new GpuChannelHost(this, client_id); 902 gpu_channel_ = new GpuChannelHost(this, client_id);
900 gpu_channel_->set_gpu_info(gpu_info); 903 gpu_channel_->set_gpu_info(gpu_info);
901 content::GetContentClient()->SetGpuInfo(gpu_info); 904 content::GetContentClient()->SetGpuInfo(gpu_info);
902 905
903 // Connect to the GPU process if a channel name was received. 906 // Connect to the GPU process if a channel name was received.
904 gpu_channel_->Connect(channel_handle, renderer_process_for_gpu); 907 gpu_channel_->Connect(channel_handle, renderer_process_for_gpu);
905 908
906 return GetGpuChannel(); 909 return GetGpuChannel();
907 } 910 }
908 911
912 WebKit::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter(
913 WebKit::WebMediaStreamCenterClient* client) {
914 if (!CommandLine::ForCurrentProcess()->HasSwitch(
915 switches::kEnableMediaStream)) {
916 return NULL;
917 }
918 if (!media_stream_center_)
919 media_stream_center_ = new content::MediaStreamCenter(client);
920 return media_stream_center_;
921 }
922
909 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { 923 GpuChannelHost* RenderThreadImpl::GetGpuChannel() {
910 if (!gpu_channel_.get()) 924 if (!gpu_channel_.get())
911 return NULL; 925 return NULL;
912 926
913 if (gpu_channel_->state() != GpuChannelHost::kConnected) 927 if (gpu_channel_->state() != GpuChannelHost::kConnected)
914 return NULL; 928 return NULL;
915 929
916 return gpu_channel_.get(); 930 return gpu_channel_.get();
917 } 931 }
918 932
(...skipping 22 matching lines...) Expand all
941 955
942 scoped_refptr<base::MessageLoopProxy> 956 scoped_refptr<base::MessageLoopProxy>
943 RenderThreadImpl::GetFileThreadMessageLoopProxy() { 957 RenderThreadImpl::GetFileThreadMessageLoopProxy() {
944 DCHECK(message_loop() == MessageLoop::current()); 958 DCHECK(message_loop() == MessageLoop::current());
945 if (!file_thread_.get()) { 959 if (!file_thread_.get()) {
946 file_thread_.reset(new base::Thread("Renderer::FILE")); 960 file_thread_.reset(new base::Thread("Renderer::FILE"));
947 file_thread_->Start(); 961 file_thread_->Start();
948 } 962 }
949 return file_thread_->message_loop_proxy(); 963 return file_thread_->message_loop_proxy();
950 } 964 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698