| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/media/webrtc/peer_connection_dependency_factory.h" | 5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "content/renderer/media/webrtc_logging.h" | 39 #include "content/renderer/media/webrtc_logging.h" |
| 40 #include "content/renderer/media/webrtc_uma_histograms.h" | 40 #include "content/renderer/media/webrtc_uma_histograms.h" |
| 41 #include "content/renderer/p2p/empty_network_manager.h" | 41 #include "content/renderer/p2p/empty_network_manager.h" |
| 42 #include "content/renderer/p2p/filtering_network_manager.h" | 42 #include "content/renderer/p2p/filtering_network_manager.h" |
| 43 #include "content/renderer/p2p/ipc_network_manager.h" | 43 #include "content/renderer/p2p/ipc_network_manager.h" |
| 44 #include "content/renderer/p2p/ipc_socket_factory.h" | 44 #include "content/renderer/p2p/ipc_socket_factory.h" |
| 45 #include "content/renderer/p2p/port_allocator.h" | 45 #include "content/renderer/p2p/port_allocator.h" |
| 46 #include "content/renderer/render_frame_impl.h" | 46 #include "content/renderer/render_frame_impl.h" |
| 47 #include "content/renderer/render_thread_impl.h" | 47 #include "content/renderer/render_thread_impl.h" |
| 48 #include "content/renderer/render_view_impl.h" | 48 #include "content/renderer/render_view_impl.h" |
| 49 #include "crypto/openssl_util.h" |
| 49 #include "jingle/glue/thread_wrapper.h" | 50 #include "jingle/glue/thread_wrapper.h" |
| 50 #include "media/base/media_permission.h" | 51 #include "media/base/media_permission.h" |
| 51 #include "media/renderers/gpu_video_accelerator_factories.h" | 52 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 52 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 53 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
| 53 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 54 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 54 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 55 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 55 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 56 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 56 #include "third_party/WebKit/public/platform/WebURL.h" | 57 #include "third_party/WebKit/public/platform/WebURL.h" |
| 57 #include "third_party/WebKit/public/web/WebDocument.h" | 58 #include "third_party/WebKit/public/web/WebDocument.h" |
| 58 #include "third_party/WebKit/public/web/WebFrame.h" | 59 #include "third_party/WebKit/public/web/WebFrame.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 base::Bind(&PeerConnectionDependencyFactory:: | 354 base::Bind(&PeerConnectionDependencyFactory:: |
| 354 CreateIpcNetworkManagerOnWorkerThread, | 355 CreateIpcNetworkManagerOnWorkerThread, |
| 355 base::Unretained(this), &create_network_manager_event)); | 356 base::Unretained(this), &create_network_manager_event)); |
| 356 | 357 |
| 357 start_worker_event.Wait(); | 358 start_worker_event.Wait(); |
| 358 create_network_manager_event.Wait(); | 359 create_network_manager_event.Wait(); |
| 359 | 360 |
| 360 CHECK(worker_thread_); | 361 CHECK(worker_thread_); |
| 361 | 362 |
| 362 // Init SSL, which will be needed by PeerConnection. | 363 // Init SSL, which will be needed by PeerConnection. |
| 364 // |
| 365 // TODO(davidben): BoringSSL must be initialized by Chromium code. If the |
| 366 // initialization requirement is removed or when different libraries are |
| 367 // allowed to call CRYPTO_library_init concurrently, remove this line and |
| 368 // initialize within WebRTC. See https://crbug.com/542879. |
| 369 crypto::EnsureOpenSSLInit(); |
| 363 if (!rtc::InitializeSSL()) { | 370 if (!rtc::InitializeSSL()) { |
| 364 LOG(ERROR) << "Failed on InitializeSSL."; | 371 LOG(ERROR) << "Failed on InitializeSSL."; |
| 365 NOTREACHED(); | 372 NOTREACHED(); |
| 366 return; | 373 return; |
| 367 } | 374 } |
| 368 | 375 |
| 369 base::WaitableEvent start_signaling_event(true, false); | 376 base::WaitableEvent start_signaling_event(true, false); |
| 370 chrome_signaling_thread_.task_runner()->PostTask( | 377 chrome_signaling_thread_.task_runner()->PostTask( |
| 371 FROM_HERE, | 378 FROM_HERE, |
| 372 base::Bind(&PeerConnectionDependencyFactory::InitializeSignalingThread, | 379 base::Bind(&PeerConnectionDependencyFactory::InitializeSignalingThread, |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 } | 813 } |
| 807 | 814 |
| 808 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 815 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 809 if (audio_device_.get()) | 816 if (audio_device_.get()) |
| 810 return; | 817 return; |
| 811 | 818 |
| 812 audio_device_ = new WebRtcAudioDeviceImpl(); | 819 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 813 } | 820 } |
| 814 | 821 |
| 815 } // namespace content | 822 } // namespace content |
| OLD | NEW |