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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 chrome_signaling_thread_("Chrome_libJingle_Signaling"), | 110 chrome_signaling_thread_("Chrome_libJingle_Signaling"), |
111 chrome_worker_thread_("Chrome_libJingle_WorkerThread") { | 111 chrome_worker_thread_("Chrome_libJingle_WorkerThread") { |
112 TryScheduleStunProbeTrial(); | 112 TryScheduleStunProbeTrial(); |
113 } | 113 } |
114 | 114 |
115 PeerConnectionDependencyFactory::~PeerConnectionDependencyFactory() { | 115 PeerConnectionDependencyFactory::~PeerConnectionDependencyFactory() { |
116 DVLOG(1) << "~PeerConnectionDependencyFactory()"; | 116 DVLOG(1) << "~PeerConnectionDependencyFactory()"; |
117 DCHECK(!pc_factory_); | 117 DCHECK(!pc_factory_); |
118 } | 118 } |
119 | 119 |
120 blink::WebRTCPeerConnectionHandler* | 120 std::unique_ptr<blink::WebRTCPeerConnectionHandler> |
121 PeerConnectionDependencyFactory::CreateRTCPeerConnectionHandler( | 121 PeerConnectionDependencyFactory::CreateRTCPeerConnectionHandler( |
122 blink::WebRTCPeerConnectionHandlerClient* client) { | 122 blink::WebRTCPeerConnectionHandlerClient* client) { |
123 // Save histogram data so we can see how much PeerConnetion is used. | 123 // Save histogram data so we can see how much PeerConnetion is used. |
124 // The histogram counts the number of calls to the JS API | 124 // The histogram counts the number of calls to the JS API |
125 // webKitRTCPeerConnection. | 125 // webKitRTCPeerConnection. |
126 UpdateWebRTCMethodCount(WEBKIT_RTC_PEER_CONNECTION); | 126 UpdateWebRTCMethodCount(WEBKIT_RTC_PEER_CONNECTION); |
127 | 127 |
128 return new RTCPeerConnectionHandler(client, this); | 128 return base::MakeUnique<RTCPeerConnectionHandler>(client, this); |
129 } | 129 } |
130 | 130 |
131 const scoped_refptr<webrtc::PeerConnectionFactoryInterface>& | 131 const scoped_refptr<webrtc::PeerConnectionFactoryInterface>& |
132 PeerConnectionDependencyFactory::GetPcFactory() { | 132 PeerConnectionDependencyFactory::GetPcFactory() { |
133 if (!pc_factory_.get()) | 133 if (!pc_factory_.get()) |
134 CreatePeerConnectionFactory(); | 134 CreatePeerConnectionFactory(); |
135 CHECK(pc_factory_.get()); | 135 CHECK(pc_factory_.get()); |
136 return pc_factory_; | 136 return pc_factory_; |
137 } | 137 } |
138 | 138 |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 | 554 |
555 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 555 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
556 DCHECK(CalledOnValidThread()); | 556 DCHECK(CalledOnValidThread()); |
557 if (audio_device_.get()) | 557 if (audio_device_.get()) |
558 return; | 558 return; |
559 | 559 |
560 audio_device_ = new WebRtcAudioDeviceImpl(); | 560 audio_device_ = new WebRtcAudioDeviceImpl(); |
561 } | 561 } |
562 | 562 |
563 } // namespace content | 563 } // namespace content |
OLD | NEW |