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

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

Issue 2677233002: Expose RTCPeerConnection.icegatheringstatechange. (Closed)
Patch Set: fix number of passing tests Created 3 years, 9 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 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) { 1388 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) {
1389 if (m_signalingState != SignalingStateClosed && 1389 if (m_signalingState != SignalingStateClosed &&
1390 m_signalingState != signalingState) { 1390 m_signalingState != signalingState) {
1391 m_signalingState = signalingState; 1391 m_signalingState = signalingState;
1392 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange)); 1392 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange));
1393 } 1393 }
1394 } 1394 }
1395 1395
1396 void RTCPeerConnection::changeIceGatheringState( 1396 void RTCPeerConnection::changeIceGatheringState(
1397 ICEGatheringState iceGatheringState) { 1397 ICEGatheringState iceGatheringState) {
1398 m_iceGatheringState = iceGatheringState; 1398 if (m_iceConnectionState != ICEConnectionStateClosed &&
1399 m_iceGatheringState != iceGatheringState) {
1400 m_iceGatheringState = iceGatheringState;
1401 scheduleDispatchEvent(
1402 Event::create(EventTypeNames::icegatheringstatechange));
1403 }
1399 } 1404 }
1400 1405
1401 bool RTCPeerConnection::setIceConnectionState( 1406 bool RTCPeerConnection::setIceConnectionState(
1402 ICEConnectionState iceConnectionState) { 1407 ICEConnectionState iceConnectionState) {
1403 if (m_iceConnectionState != ICEConnectionStateClosed && 1408 if (m_iceConnectionState != ICEConnectionStateClosed &&
1404 m_iceConnectionState != iceConnectionState) { 1409 m_iceConnectionState != iceConnectionState) {
1405 m_iceConnectionState = iceConnectionState; 1410 m_iceConnectionState = iceConnectionState;
1406 if (m_iceConnectionState == ICEConnectionStateConnected) 1411 if (m_iceConnectionState == ICEConnectionStateConnected)
1407 recordRapporMetrics(); 1412 recordRapporMetrics();
1408 1413
(...skipping 11 matching lines...) Expand all
1420 wrapPersistent(this), iceConnectionState)); 1425 wrapPersistent(this), iceConnectionState));
1421 } 1426 }
1422 } 1427 }
1423 1428
1424 void RTCPeerConnection::closeInternal() { 1429 void RTCPeerConnection::closeInternal() {
1425 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); 1430 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed);
1426 m_peerHandler->stop(); 1431 m_peerHandler->stop();
1427 m_closed = true; 1432 m_closed = true;
1428 1433
1429 changeIceConnectionState(ICEConnectionStateClosed); 1434 changeIceConnectionState(ICEConnectionStateClosed);
1430 changeIceGatheringState(ICEGatheringStateComplete);
1431 changeSignalingState(SignalingStateClosed); 1435 changeSignalingState(SignalingStateClosed);
1432 Document* document = toDocument(getExecutionContext()); 1436 Document* document = toDocument(getExecutionContext());
1433 HostsUsingFeatures::countAnyWorld( 1437 HostsUsingFeatures::countAnyWorld(
1434 *document, HostsUsingFeatures::Feature::RTCPeerConnectionUsed); 1438 *document, HostsUsingFeatures::Feature::RTCPeerConnectionUsed);
1435 1439
1436 m_connectionHandleForScheduler.reset(); 1440 m_connectionHandleForScheduler.reset();
1437 } 1441 }
1438 1442
1439 void RTCPeerConnection::scheduleDispatchEvent(Event* event) { 1443 void RTCPeerConnection::scheduleDispatchEvent(Event* event) {
1440 scheduleDispatchEvent(event, nullptr); 1444 scheduleDispatchEvent(event, nullptr);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 DEFINE_TRACE(RTCPeerConnection) { 1498 DEFINE_TRACE(RTCPeerConnection) {
1495 visitor->trace(m_localStreams); 1499 visitor->trace(m_localStreams);
1496 visitor->trace(m_remoteStreams); 1500 visitor->trace(m_remoteStreams);
1497 visitor->trace(m_dispatchScheduledEventRunner); 1501 visitor->trace(m_dispatchScheduledEventRunner);
1498 visitor->trace(m_scheduledEvents); 1502 visitor->trace(m_scheduledEvents);
1499 EventTargetWithInlineData::trace(visitor); 1503 EventTargetWithInlineData::trace(visitor);
1500 SuspendableObject::trace(visitor); 1504 SuspendableObject::trace(visitor);
1501 } 1505 }
1502 1506
1503 } // namespace blink 1507 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698