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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
890 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"))); | 890 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"))); |
891 if (gpu_vda_context3d_.get()) | 891 if (gpu_vda_context3d_.get()) |
892 gpu_vda_context3d_->setContextLostCallback(context_lost_cb_.get()); | 892 gpu_vda_context3d_->setContextLostCallback(context_lost_cb_.get()); |
893 } | 893 } |
894 return gpu_vda_context3d_.get(); | 894 return gpu_vda_context3d_.get(); |
895 } | 895 } |
896 | 896 |
897 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { | 897 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { |
898 if (!audio_renderer_mixer_manager_.get()) { | 898 if (!audio_renderer_mixer_manager_.get()) { |
899 audio_renderer_mixer_manager_.reset(new AudioRendererMixerManager( | 899 audio_renderer_mixer_manager_.reset(new AudioRendererMixerManager( |
900 GetAudioOutputSampleRate(), | 900 GetAudioHardwareConfig())); |
901 GetAudioOutputBufferSize())); | |
902 } | 901 } |
903 | 902 |
904 return audio_renderer_mixer_manager_.get(); | 903 return audio_renderer_mixer_manager_.get(); |
905 } | 904 } |
906 | 905 |
906 media::AudioHardwareConfig* RenderThreadImpl::GetAudioHardwareConfig() { | |
907 if (!audio_hardware_config_) { | |
908 int output_buffer_size; | |
909 int output_sample_rate; | |
910 int input_sample_rate; | |
911 media::ChannelLayout input_channel_layout; | |
912 | |
913 Send(new ViewHostMsg_GetAudioHardwareConfig( | |
914 &output_buffer_size, &output_sample_rate, | |
915 &input_sample_rate, &input_channel_layout)); | |
916 | |
917 audio_hardware_config_.reset(new media::AudioHardwareConfig( | |
918 output_buffer_size, output_sample_rate, input_sample_rate, | |
919 input_channel_layout)); | |
920 audio_message_filter_->SetAudioHardwareConfig(audio_hardware_config_.get()); | |
henrika (OOO until Aug 14)
2013/01/30 10:28:13
Nice!
| |
921 } | |
922 | |
923 return audio_hardware_config_.get(); | |
924 } | |
925 | |
907 #if defined(OS_WIN) | 926 #if defined(OS_WIN) |
908 void RenderThreadImpl::PreCacheFontCharacters(const LOGFONT& log_font, | 927 void RenderThreadImpl::PreCacheFontCharacters(const LOGFONT& log_font, |
909 const string16& str) { | 928 const string16& str) { |
910 Send(new ViewHostMsg_PreCacheFontCharacters(log_font, str)); | 929 Send(new ViewHostMsg_PreCacheFontCharacters(log_font, str)); |
911 } | 930 } |
912 | 931 |
913 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { | 932 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { |
914 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); | 933 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); |
915 } | 934 } |
916 | 935 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1152 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1171 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
1153 DCHECK(message_loop() == MessageLoop::current()); | 1172 DCHECK(message_loop() == MessageLoop::current()); |
1154 if (!file_thread_.get()) { | 1173 if (!file_thread_.get()) { |
1155 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1174 file_thread_.reset(new base::Thread("Renderer::FILE")); |
1156 file_thread_->Start(); | 1175 file_thread_->Start(); |
1157 } | 1176 } |
1158 return file_thread_->message_loop_proxy(); | 1177 return file_thread_->message_loop_proxy(); |
1159 } | 1178 } |
1160 | 1179 |
1161 } // namespace content | 1180 } // namespace content |
OLD | NEW |