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

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp

Issue 2677233002: Expose RTCPeerConnection.icegatheringstatechange. (Closed)
Patch Set: codereview feedback Created 3 years, 10 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
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 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) { 1382 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) {
1383 if (m_signalingState != SignalingStateClosed && 1383 if (m_signalingState != SignalingStateClosed &&
1384 m_signalingState != signalingState) { 1384 m_signalingState != signalingState) {
1385 m_signalingState = signalingState; 1385 m_signalingState = signalingState;
1386 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange)); 1386 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange));
1387 } 1387 }
1388 } 1388 }
1389 1389
1390 void RTCPeerConnection::changeIceGatheringState( 1390 void RTCPeerConnection::changeIceGatheringState(
1391 ICEGatheringState iceGatheringState) { 1391 ICEGatheringState iceGatheringState) {
1392 m_iceGatheringState = iceGatheringState; 1392 if (m_iceConnectionState != ICEConnectionStateClosed &&
1393 m_iceGatheringState != iceGatheringState) {
1394 m_iceGatheringState = iceGatheringState;
1395 scheduleDispatchEvent(
1396 Event::create(EventTypeNames::icegatheringstatechange));
1397 }
1393 } 1398 }
1394 1399
1395 bool RTCPeerConnection::setIceConnectionState( 1400 bool RTCPeerConnection::setIceConnectionState(
1396 ICEConnectionState iceConnectionState) { 1401 ICEConnectionState iceConnectionState) {
1397 if (m_iceConnectionState != ICEConnectionStateClosed && 1402 if (m_iceConnectionState != ICEConnectionStateClosed &&
1398 m_iceConnectionState != iceConnectionState) { 1403 m_iceConnectionState != iceConnectionState) {
1399 m_iceConnectionState = iceConnectionState; 1404 m_iceConnectionState = iceConnectionState;
1400 if (m_iceConnectionState == ICEConnectionStateConnected) 1405 if (m_iceConnectionState == ICEConnectionStateConnected)
1401 recordRapporMetrics(); 1406 recordRapporMetrics();
1402 1407
(...skipping 11 matching lines...) Expand all
1414 wrapPersistent(this), iceConnectionState)); 1419 wrapPersistent(this), iceConnectionState));
1415 } 1420 }
1416 } 1421 }
1417 1422
1418 void RTCPeerConnection::closeInternal() { 1423 void RTCPeerConnection::closeInternal() {
1419 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); 1424 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed);
1420 m_peerHandler->stop(); 1425 m_peerHandler->stop();
1421 m_closed = true; 1426 m_closed = true;
1422 1427
1423 changeIceConnectionState(ICEConnectionStateClosed); 1428 changeIceConnectionState(ICEConnectionStateClosed);
1424 changeIceGatheringState(ICEGatheringStateComplete);
1425 changeSignalingState(SignalingStateClosed); 1429 changeSignalingState(SignalingStateClosed);
1426 Document* document = toDocument(getExecutionContext()); 1430 Document* document = toDocument(getExecutionContext());
1427 HostsUsingFeatures::countAnyWorld( 1431 HostsUsingFeatures::countAnyWorld(
1428 *document, HostsUsingFeatures::Feature::RTCPeerConnectionUsed); 1432 *document, HostsUsingFeatures::Feature::RTCPeerConnectionUsed);
1429 } 1433 }
1430 1434
1431 void RTCPeerConnection::scheduleDispatchEvent(Event* event) { 1435 void RTCPeerConnection::scheduleDispatchEvent(Event* event) {
1432 scheduleDispatchEvent(event, nullptr); 1436 scheduleDispatchEvent(event, nullptr);
1433 } 1437 }
1434 1438
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 DEFINE_TRACE(RTCPeerConnection) { 1490 DEFINE_TRACE(RTCPeerConnection) {
1487 visitor->trace(m_localStreams); 1491 visitor->trace(m_localStreams);
1488 visitor->trace(m_remoteStreams); 1492 visitor->trace(m_remoteStreams);
1489 visitor->trace(m_dispatchScheduledEventRunner); 1493 visitor->trace(m_dispatchScheduledEventRunner);
1490 visitor->trace(m_scheduledEvents); 1494 visitor->trace(m_scheduledEvents);
1491 EventTargetWithInlineData::trace(visitor); 1495 EventTargetWithInlineData::trace(visitor);
1492 SuspendableObject::trace(visitor); 1496 SuspendableObject::trace(visitor);
1493 } 1497 }
1494 1498
1495 } // namespace blink 1499 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698