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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "content/public/renderer/content_renderer_client.h" | 48 #include "content/public/renderer/content_renderer_client.h" |
49 #include "content/public/renderer/render_process_observer.h" | 49 #include "content/public/renderer/render_process_observer.h" |
50 #include "content/public/renderer/render_view_visitor.h" | 50 #include "content/public/renderer/render_view_visitor.h" |
51 #include "content/renderer/devtools/devtools_agent_filter.h" | 51 #include "content/renderer/devtools/devtools_agent_filter.h" |
52 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 52 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
53 #include "content/renderer/dom_storage/webstoragearea_impl.h" | 53 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
54 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 54 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
55 #include "content/renderer/gpu/compositor_thread.h" | 55 #include "content/renderer/gpu/compositor_thread.h" |
56 #include "content/renderer/gpu/compositor_output_surface.h" | 56 #include "content/renderer/gpu/compositor_output_surface.h" |
57 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 57 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
58 #include "content/renderer/media/audio_hardware.h" | |
59 #include "content/renderer/media/audio_input_message_filter.h" | 58 #include "content/renderer/media/audio_input_message_filter.h" |
60 #include "content/renderer/media/audio_message_filter.h" | 59 #include "content/renderer/media/audio_message_filter.h" |
61 #include "content/renderer/media/audio_renderer_mixer_manager.h" | 60 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
62 #include "content/renderer/media/media_stream_center.h" | 61 #include "content/renderer/media/media_stream_center.h" |
63 #include "content/renderer/media/media_stream_dependency_factory.h" | 62 #include "content/renderer/media/media_stream_dependency_factory.h" |
64 #include "content/renderer/media/peer_connection_tracker.h" | 63 #include "content/renderer/media/peer_connection_tracker.h" |
65 #include "content/renderer/media/video_capture_impl_manager.h" | 64 #include "content/renderer/media/video_capture_impl_manager.h" |
66 #include "content/renderer/media/video_capture_message_filter.h" | 65 #include "content/renderer/media/video_capture_message_filter.h" |
67 #include "content/renderer/p2p/socket_dispatcher.h" | 66 #include "content/renderer/p2p/socket_dispatcher.h" |
68 #include "content/renderer/plugin_channel_host.h" | 67 #include "content/renderer/plugin_channel_host.h" |
69 #include "content/renderer/render_process_impl.h" | 68 #include "content/renderer/render_process_impl.h" |
70 #include "content/renderer/render_view_impl.h" | 69 #include "content/renderer/render_view_impl.h" |
71 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 70 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
72 #include "grit/content_resources.h" | 71 #include "grit/content_resources.h" |
73 #include "ipc/ipc_channel_handle.h" | 72 #include "ipc/ipc_channel_handle.h" |
74 #include "ipc/ipc_forwarding_message_filter.h" | 73 #include "ipc/ipc_forwarding_message_filter.h" |
75 #include "ipc/ipc_platform_file.h" | 74 #include "ipc/ipc_platform_file.h" |
| 75 #include "media/base/audio_hardware_config.h" |
76 #include "media/base/media.h" | 76 #include "media/base/media.h" |
77 #include "media/base/media_switches.h" | 77 #include "media/base/media_switches.h" |
78 #include "net/base/net_errors.h" | 78 #include "net/base/net_errors.h" |
79 #include "net/base/net_util.h" | 79 #include "net/base/net_util.h" |
80 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" | 80 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
81 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSuppor
t.h" | 81 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSuppor
t.h" |
82 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 82 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" | 83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" |
84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
85 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 85 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"))); | 897 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"))); |
898 if (gpu_vda_context3d_.get()) | 898 if (gpu_vda_context3d_.get()) |
899 gpu_vda_context3d_->setContextLostCallback(context_lost_cb_.get()); | 899 gpu_vda_context3d_->setContextLostCallback(context_lost_cb_.get()); |
900 } | 900 } |
901 return gpu_vda_context3d_.get(); | 901 return gpu_vda_context3d_.get(); |
902 } | 902 } |
903 | 903 |
904 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { | 904 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { |
905 if (!audio_renderer_mixer_manager_.get()) { | 905 if (!audio_renderer_mixer_manager_.get()) { |
906 audio_renderer_mixer_manager_.reset(new AudioRendererMixerManager( | 906 audio_renderer_mixer_manager_.reset(new AudioRendererMixerManager( |
907 GetAudioOutputSampleRate(), | 907 GetAudioHardwareConfig())); |
908 GetAudioOutputBufferSize())); | |
909 } | 908 } |
910 | 909 |
911 return audio_renderer_mixer_manager_.get(); | 910 return audio_renderer_mixer_manager_.get(); |
912 } | 911 } |
913 | 912 |
| 913 media::AudioHardwareConfig* RenderThreadImpl::GetAudioHardwareConfig() { |
| 914 if (!audio_hardware_config_) { |
| 915 int output_buffer_size; |
| 916 int output_sample_rate; |
| 917 int input_sample_rate; |
| 918 media::ChannelLayout input_channel_layout; |
| 919 |
| 920 Send(new ViewHostMsg_GetAudioHardwareConfig( |
| 921 &output_buffer_size, &output_sample_rate, |
| 922 &input_sample_rate, &input_channel_layout)); |
| 923 |
| 924 audio_hardware_config_.reset(new media::AudioHardwareConfig( |
| 925 output_buffer_size, output_sample_rate, input_sample_rate, |
| 926 input_channel_layout)); |
| 927 audio_message_filter_->SetAudioHardwareConfig(audio_hardware_config_.get()); |
| 928 } |
| 929 |
| 930 return audio_hardware_config_.get(); |
| 931 } |
| 932 |
914 #if defined(OS_WIN) | 933 #if defined(OS_WIN) |
915 void RenderThreadImpl::PreCacheFontCharacters(const LOGFONT& log_font, | 934 void RenderThreadImpl::PreCacheFontCharacters(const LOGFONT& log_font, |
916 const string16& str) { | 935 const string16& str) { |
917 Send(new ViewHostMsg_PreCacheFontCharacters(log_font, str)); | 936 Send(new ViewHostMsg_PreCacheFontCharacters(log_font, str)); |
918 } | 937 } |
919 | 938 |
920 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { | 939 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { |
921 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); | 940 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); |
922 } | 941 } |
923 | 942 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1184 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
1166 DCHECK(message_loop() == MessageLoop::current()); | 1185 DCHECK(message_loop() == MessageLoop::current()); |
1167 if (!file_thread_.get()) { | 1186 if (!file_thread_.get()) { |
1168 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1187 file_thread_.reset(new base::Thread("Renderer::FILE")); |
1169 file_thread_->Start(); | 1188 file_thread_->Start(); |
1170 } | 1189 } |
1171 return file_thread_->message_loop_proxy(); | 1190 return file_thread_->message_loop_proxy(); |
1172 } | 1191 } |
1173 | 1192 |
1174 } // namespace content | 1193 } // namespace content |
OLD | NEW |