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

Side by Side Diff: Source/modules/mediastream/RTCPeerConnection.cpp

Issue 61773005: Rename WebKit namespace to blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 es.throwUninformativeAndGenericDOMException(TypeMismatchError); 219 es.throwUninformativeAndGenericDOMException(TypeMismatchError);
220 return; 220 return;
221 } 221 }
222 222
223 RefPtr<RTCVoidRequestImpl> request = RTCVoidRequestImpl::create(executionCon text(), successCallback, errorCallback); 223 RefPtr<RTCVoidRequestImpl> request = RTCVoidRequestImpl::create(executionCon text(), successCallback, errorCallback);
224 m_peerHandler->setLocalDescription(request.release(), sessionDescription->we bSessionDescription()); 224 m_peerHandler->setLocalDescription(request.release(), sessionDescription->we bSessionDescription());
225 } 225 }
226 226
227 PassRefPtr<RTCSessionDescription> RTCPeerConnection::localDescription(ExceptionS tate& es) 227 PassRefPtr<RTCSessionDescription> RTCPeerConnection::localDescription(ExceptionS tate& es)
228 { 228 {
229 WebKit::WebRTCSessionDescription webSessionDescription = m_peerHandler->loca lDescription(); 229 blink::WebRTCSessionDescription webSessionDescription = m_peerHandler->local Description();
230 if (webSessionDescription.isNull()) 230 if (webSessionDescription.isNull())
231 return 0; 231 return 0;
232 232
233 RefPtr<RTCSessionDescription> sessionDescription = RTCSessionDescription::cr eate(webSessionDescription); 233 RefPtr<RTCSessionDescription> sessionDescription = RTCSessionDescription::cr eate(webSessionDescription);
234 return sessionDescription.release(); 234 return sessionDescription.release();
235 } 235 }
236 236
237 void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> p rpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCEr rorCallback> errorCallback, ExceptionState& es) 237 void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> p rpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCEr rorCallback> errorCallback, ExceptionState& es)
238 { 238 {
239 if (m_signalingState == SignalingStateClosed) { 239 if (m_signalingState == SignalingStateClosed) {
240 es.throwUninformativeAndGenericDOMException(InvalidStateError); 240 es.throwUninformativeAndGenericDOMException(InvalidStateError);
241 return; 241 return;
242 } 242 }
243 243
244 RefPtr<RTCSessionDescription> sessionDescription = prpSessionDescription; 244 RefPtr<RTCSessionDescription> sessionDescription = prpSessionDescription;
245 if (!sessionDescription) { 245 if (!sessionDescription) {
246 es.throwUninformativeAndGenericDOMException(TypeMismatchError); 246 es.throwUninformativeAndGenericDOMException(TypeMismatchError);
247 return; 247 return;
248 } 248 }
249 249
250 RefPtr<RTCVoidRequestImpl> request = RTCVoidRequestImpl::create(executionCon text(), successCallback, errorCallback); 250 RefPtr<RTCVoidRequestImpl> request = RTCVoidRequestImpl::create(executionCon text(), successCallback, errorCallback);
251 m_peerHandler->setRemoteDescription(request.release(), sessionDescription->w ebSessionDescription()); 251 m_peerHandler->setRemoteDescription(request.release(), sessionDescription->w ebSessionDescription());
252 } 252 }
253 253
254 PassRefPtr<RTCSessionDescription> RTCPeerConnection::remoteDescription(Exception State& es) 254 PassRefPtr<RTCSessionDescription> RTCPeerConnection::remoteDescription(Exception State& es)
255 { 255 {
256 WebKit::WebRTCSessionDescription webSessionDescription = m_peerHandler->remo teDescription(); 256 blink::WebRTCSessionDescription webSessionDescription = m_peerHandler->remot eDescription();
257 if (webSessionDescription.isNull()) 257 if (webSessionDescription.isNull())
258 return 0; 258 return 0;
259 259
260 RefPtr<RTCSessionDescription> desc = RTCSessionDescription::create(webSessio nDescription); 260 RefPtr<RTCSessionDescription> desc = RTCSessionDescription::create(webSessio nDescription);
261 return desc.release(); 261 return desc.release();
262 } 262 }
263 263
264 void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dict ionary& mediaConstraints, ExceptionState& es) 264 void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dict ionary& mediaConstraints, ExceptionState& es)
265 { 265 {
266 if (m_signalingState == SignalingStateClosed) { 266 if (m_signalingState == SignalingStateClosed) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 m_peerHandler->getStats(statsRequest.release()); 458 m_peerHandler->getStats(statsRequest.release());
459 } 459 }
460 460
461 PassRefPtr<RTCDataChannel> RTCPeerConnection::createDataChannel(String label, co nst Dictionary& options, ExceptionState& es) 461 PassRefPtr<RTCDataChannel> RTCPeerConnection::createDataChannel(String label, co nst Dictionary& options, ExceptionState& es)
462 { 462 {
463 if (m_signalingState == SignalingStateClosed) { 463 if (m_signalingState == SignalingStateClosed) {
464 es.throwUninformativeAndGenericDOMException(InvalidStateError); 464 es.throwUninformativeAndGenericDOMException(InvalidStateError);
465 return 0; 465 return 0;
466 } 466 }
467 467
468 WebKit::WebRTCDataChannelInit init; 468 blink::WebRTCDataChannelInit init;
469 options.get("ordered", init.ordered); 469 options.get("ordered", init.ordered);
470 options.get("negotiated", init.negotiated); 470 options.get("negotiated", init.negotiated);
471 471
472 unsigned short value = 0; 472 unsigned short value = 0;
473 if (options.get("id", value)) 473 if (options.get("id", value))
474 init.id = value; 474 init.id = value;
475 if (options.get("maxRetransmits", value)) 475 if (options.get("maxRetransmits", value))
476 init.maxRetransmits = value; 476 init.maxRetransmits = value;
477 if (options.get("maxRetransmitTime", value)) 477 if (options.get("maxRetransmitTime", value))
478 init.maxRetransmitTime = value; 478 init.maxRetransmitTime = value;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 changeIceConnectionState(IceConnectionStateClosed); 534 changeIceConnectionState(IceConnectionStateClosed);
535 changeIceGatheringState(IceGatheringStateComplete); 535 changeIceGatheringState(IceGatheringStateComplete);
536 changeSignalingState(SignalingStateClosed); 536 changeSignalingState(SignalingStateClosed);
537 } 537 }
538 538
539 void RTCPeerConnection::negotiationNeeded() 539 void RTCPeerConnection::negotiationNeeded()
540 { 540 {
541 scheduleDispatchEvent(Event::create(EventTypeNames::negotiationneeded)); 541 scheduleDispatchEvent(Event::create(EventTypeNames::negotiationneeded));
542 } 542 }
543 543
544 void RTCPeerConnection::didGenerateIceCandidate(WebKit::WebRTCICECandidate webCa ndidate) 544 void RTCPeerConnection::didGenerateIceCandidate(blink::WebRTCICECandidate webCan didate)
545 { 545 {
546 ASSERT(executionContext()->isContextThread()); 546 ASSERT(executionContext()->isContextThread());
547 if (webCandidate.isNull()) 547 if (webCandidate.isNull())
548 scheduleDispatchEvent(RTCIceCandidateEvent::create(false, false, 0)); 548 scheduleDispatchEvent(RTCIceCandidateEvent::create(false, false, 0));
549 else { 549 else {
550 RefPtr<RTCIceCandidate> iceCandidate = RTCIceCandidate::create(webCandid ate); 550 RefPtr<RTCIceCandidate> iceCandidate = RTCIceCandidate::create(webCandid ate);
551 scheduleDispatchEvent(RTCIceCandidateEvent::create(false, false, iceCand idate.release())); 551 scheduleDispatchEvent(RTCIceCandidateEvent::create(false, false, iceCand idate.release()));
552 } 552 }
553 } 553 }
554 554
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 events.swap(m_scheduledEvents); 687 events.swap(m_scheduledEvents);
688 688
689 Vector<RefPtr<Event> >::iterator it = events.begin(); 689 Vector<RefPtr<Event> >::iterator it = events.begin();
690 for (; it != events.end(); ++it) 690 for (; it != events.end(); ++it)
691 dispatchEvent((*it).release()); 691 dispatchEvent((*it).release());
692 692
693 events.clear(); 693 events.clear();
694 } 694 }
695 695
696 } // namespace WebCore 696 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediastream/RTCPeerConnection.h ('k') | Source/modules/mediastream/RTCSessionDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698