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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 650 |
651 WebRuntimeFeatures::enableGeolocation( | 651 WebRuntimeFeatures::enableGeolocation( |
652 !command_line.HasSwitch(switches::kDisableGeolocation)); | 652 !command_line.HasSwitch(switches::kDisableGeolocation)); |
653 | 653 |
654 WebKit::WebRuntimeFeatures::enableMediaSource( | 654 WebKit::WebRuntimeFeatures::enableMediaSource( |
655 !command_line.HasSwitch(switches::kDisableMediaSource)); | 655 !command_line.HasSwitch(switches::kDisableMediaSource)); |
656 | 656 |
657 WebRuntimeFeatures::enableMediaPlayer( | 657 WebRuntimeFeatures::enableMediaPlayer( |
658 media::IsMediaLibraryInitialized()); | 658 media::IsMediaLibraryInitialized()); |
659 | 659 |
| 660 #if defined(OS_ANDROID) |
| 661 WebKit::WebRuntimeFeatures::enableMediaStream( |
| 662 command_line.HasSwitch(switches::kEnableWebRTC)); |
| 663 WebKit::WebRuntimeFeatures::enablePeerConnection( |
| 664 command_line.HasSwitch(switches::kEnableWebRTC)); |
| 665 #else |
660 WebKit::WebRuntimeFeatures::enableMediaStream(true); | 666 WebKit::WebRuntimeFeatures::enableMediaStream(true); |
661 WebKit::WebRuntimeFeatures::enablePeerConnection(true); | 667 WebKit::WebRuntimeFeatures::enablePeerConnection(true); |
| 668 #endif |
662 | 669 |
663 WebKit::WebRuntimeFeatures::enableFullScreenAPI( | 670 WebKit::WebRuntimeFeatures::enableFullScreenAPI( |
664 !command_line.HasSwitch(switches::kDisableFullScreen)); | 671 !command_line.HasSwitch(switches::kDisableFullScreen)); |
665 | 672 |
666 WebKit::WebRuntimeFeatures::enableEncryptedMedia( | 673 WebKit::WebRuntimeFeatures::enableEncryptedMedia( |
667 command_line.HasSwitch(switches::kEnableEncryptedMedia)); | 674 command_line.HasSwitch(switches::kEnableEncryptedMedia)); |
668 | 675 |
669 #if defined(OS_ANDROID) | 676 #if defined(OS_ANDROID) |
670 WebRuntimeFeatures::enableWebAudio( | 677 WebRuntimeFeatures::enableWebAudio( |
671 command_line.HasSwitch(switches::kEnableWebAudio) && | 678 command_line.HasSwitch(switches::kEnableWebAudio) && |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 GetContentClient()->SetGpuInfo(gpu_info); | 1096 GetContentClient()->SetGpuInfo(gpu_info); |
1090 | 1097 |
1091 // Connect to the GPU process if a channel name was received. | 1098 // Connect to the GPU process if a channel name was received. |
1092 gpu_channel_->Connect(channel_handle); | 1099 gpu_channel_->Connect(channel_handle); |
1093 | 1100 |
1094 return GetGpuChannel(); | 1101 return GetGpuChannel(); |
1095 } | 1102 } |
1096 | 1103 |
1097 WebKit::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( | 1104 WebKit::WebMediaStreamCenter* RenderThreadImpl::CreateMediaStreamCenter( |
1098 WebKit::WebMediaStreamCenterClient* client) { | 1105 WebKit::WebMediaStreamCenterClient* client) { |
| 1106 #if defined(OS_ANDROID) |
| 1107 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 1108 switches::kEnableWebRTC)) |
| 1109 return NULL; |
| 1110 #endif |
| 1111 |
1099 #if defined(ENABLE_WEBRTC) | 1112 #if defined(ENABLE_WEBRTC) |
1100 if (!media_stream_center_) | 1113 if (!media_stream_center_) |
1101 media_stream_center_ = new MediaStreamCenter( | 1114 media_stream_center_ = new MediaStreamCenter( |
1102 client, GetMediaStreamDependencyFactory()); | 1115 client, GetMediaStreamDependencyFactory()); |
1103 #endif | 1116 #endif |
1104 return media_stream_center_; | 1117 return media_stream_center_; |
1105 } | 1118 } |
1106 | 1119 |
1107 MediaStreamDependencyFactory* | 1120 MediaStreamDependencyFactory* |
1108 RenderThreadImpl::GetMediaStreamDependencyFactory() { | 1121 RenderThreadImpl::GetMediaStreamDependencyFactory() { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1165 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
1153 DCHECK(message_loop() == MessageLoop::current()); | 1166 DCHECK(message_loop() == MessageLoop::current()); |
1154 if (!file_thread_.get()) { | 1167 if (!file_thread_.get()) { |
1155 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1168 file_thread_.reset(new base::Thread("Renderer::FILE")); |
1156 file_thread_->Start(); | 1169 file_thread_->Start(); |
1157 } | 1170 } |
1158 return file_thread_->message_loop_proxy(); | 1171 return file_thread_->message_loop_proxy(); |
1159 } | 1172 } |
1160 | 1173 |
1161 } // namespace content | 1174 } // namespace content |
OLD | NEW |