Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 2415673003: Merge RTCConfiguration into WebRTCConfiguration (Closed)
Patch Set: headers, kConstants Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/media/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 description_callback, 180 description_callback,
181 std::string* sdp, std::string* type) { 181 std::string* sdp, std::string* type) {
182 const webrtc::SessionDescriptionInterface* description = 182 const webrtc::SessionDescriptionInterface* description =
183 description_callback.Run(); 183 description_callback.Run();
184 if (description) { 184 if (description) {
185 description->ToString(sdp); 185 description->ToString(sdp);
186 *type = description->type(); 186 *type = description->type();
187 } 187 }
188 } 188 }
189 189
190 // Converter functions from WebKit types to WebRTC types. 190 // Converter functions from Blink types to WebRTC types.
191 191
192 void GetNativeRtcConfiguration( 192 void GetNativeRtcConfiguration(
193 const blink::WebRTCConfiguration& blink_config, 193 const blink::WebRTCConfiguration& blink_config,
194 webrtc::PeerConnectionInterface::RTCConfiguration* webrtc_config) { 194 webrtc::PeerConnectionInterface::RTCConfiguration* webrtc_config) {
195 DCHECK(webrtc_config); 195 DCHECK(webrtc_config);
196 if (blink_config.isNull())
197 return;
198 196
199 for (size_t i = 0; i < blink_config.numberOfServers(); ++i) { 197 for (const blink::WebRTCIceServer& blink_server : blink_config.iceServers) {
200 webrtc::PeerConnectionInterface::IceServer server; 198 webrtc::PeerConnectionInterface::IceServer server;
201 const blink::WebRTCICEServer& webkit_server =
202 blink_config.server(i);
203 server.username = 199 server.username =
204 base::UTF16ToUTF8(base::StringPiece16(webkit_server.username())); 200 base::UTF16ToUTF8(base::StringPiece16(blink_server.username));
205 server.password = 201 server.password =
206 base::UTF16ToUTF8(base::StringPiece16(webkit_server.credential())); 202 base::UTF16ToUTF8(base::StringPiece16(blink_server.credential));
207 server.uri = webkit_server.uri().string().utf8(); 203 server.uri = blink_server.url.string().utf8();
208 webrtc_config->servers.push_back(server); 204 webrtc_config->servers.push_back(server);
209 } 205 }
210 206
211 switch (blink_config.iceTransports()) { 207 switch (blink_config.iceTransports) {
212 case blink::WebRTCIceTransportsNone: 208 case blink::WebRTCIceTransports::kNone:
213 webrtc_config->type = webrtc::PeerConnectionInterface::kNone; 209 webrtc_config->type = webrtc::PeerConnectionInterface::kNone;
214 break; 210 break;
215 case blink::WebRTCIceTransportsRelay: 211 case blink::WebRTCIceTransports::kRelay:
216 webrtc_config->type = webrtc::PeerConnectionInterface::kRelay; 212 webrtc_config->type = webrtc::PeerConnectionInterface::kRelay;
217 break; 213 break;
218 case blink::WebRTCIceTransportsAll: 214 case blink::WebRTCIceTransports::kAll:
219 webrtc_config->type = webrtc::PeerConnectionInterface::kAll; 215 webrtc_config->type = webrtc::PeerConnectionInterface::kAll;
220 break; 216 break;
221 default: 217 default:
222 NOTREACHED(); 218 NOTREACHED();
223 } 219 }
224 220
225 switch (blink_config.bundlePolicy()) { 221 switch (blink_config.bundlePolicy) {
226 case blink::WebRTCBundlePolicyBalanced: 222 case blink::WebRTCBundlePolicy::kBalanced:
227 webrtc_config->bundle_policy = 223 webrtc_config->bundle_policy =
228 webrtc::PeerConnectionInterface::kBundlePolicyBalanced; 224 webrtc::PeerConnectionInterface::kBundlePolicyBalanced;
229 break; 225 break;
230 case blink::WebRTCBundlePolicyMaxBundle: 226 case blink::WebRTCBundlePolicy::kMaxBundle:
231 webrtc_config->bundle_policy = 227 webrtc_config->bundle_policy =
232 webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle; 228 webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle;
233 break; 229 break;
234 case blink::WebRTCBundlePolicyMaxCompat: 230 case blink::WebRTCBundlePolicy::kMaxCompat:
235 webrtc_config->bundle_policy = 231 webrtc_config->bundle_policy =
236 webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat; 232 webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat;
237 break; 233 break;
238 default: 234 default:
239 NOTREACHED(); 235 NOTREACHED();
240 } 236 }
241 237
242 switch (blink_config.rtcpMuxPolicy()) { 238 switch (blink_config.rtcpMuxPolicy) {
243 case blink::WebRTCRtcpMuxPolicyNegotiate: 239 case blink::WebRTCRtcpMuxPolicy::kNegotiate:
244 webrtc_config->rtcp_mux_policy = 240 webrtc_config->rtcp_mux_policy =
245 webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate; 241 webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate;
246 break; 242 break;
247 case blink::WebRTCRtcpMuxPolicyRequire: 243 case blink::WebRTCRtcpMuxPolicy::kRequire:
248 webrtc_config->rtcp_mux_policy = 244 webrtc_config->rtcp_mux_policy =
249 webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire; 245 webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire;
250 break; 246 break;
251 default: 247 default:
252 NOTREACHED(); 248 NOTREACHED();
253 } 249 }
254 250
255 for (size_t i = 0; i < blink_config.numberOfCertificates(); ++i) { 251 for (const std::unique_ptr<blink::WebRTCCertificate>& blink_certificate :
252 blink_config.certificates) {
256 webrtc_config->certificates.push_back( 253 webrtc_config->certificates.push_back(
257 static_cast<RTCCertificate*>( 254 static_cast<RTCCertificate*>(blink_certificate.get())
258 blink_config.certificate(i))->rtcCertificate()); 255 ->rtcCertificate());
259 } 256 }
260 } 257 }
261 258
262 void CopyConstraintsIntoRtcConfiguration( 259 void CopyConstraintsIntoRtcConfiguration(
263 const blink::WebMediaConstraints constraints, 260 const blink::WebMediaConstraints constraints,
264 webrtc::PeerConnectionInterface::RTCConfiguration* configuration) { 261 webrtc::PeerConnectionInterface::RTCConfiguration* configuration) {
265 // Copy info from constraints into configuration, if present. 262 // Copy info from constraints into configuration, if present.
266 if (constraints.isEmpty()) { 263 if (constraints.isEmpty()) {
267 return; 264 return;
268 } 265 }
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 } 1950 }
1954 1951
1955 void RTCPeerConnectionHandler::ResetUMAStats() { 1952 void RTCPeerConnectionHandler::ResetUMAStats() {
1956 DCHECK(thread_checker_.CalledOnValidThread()); 1953 DCHECK(thread_checker_.CalledOnValidThread());
1957 num_local_candidates_ipv6_ = 0; 1954 num_local_candidates_ipv6_ = 0;
1958 num_local_candidates_ipv4_ = 0; 1955 num_local_candidates_ipv4_ = 0;
1959 ice_connection_checking_start_ = base::TimeTicks(); 1956 ice_connection_checking_start_ = base::TimeTicks();
1960 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); 1957 memset(ice_state_seen_, 0, sizeof(ice_state_seen_));
1961 } 1958 }
1962 } // namespace content 1959 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698