OLD | NEW |
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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 return; | 1347 return; |
1348 | 1348 |
1349 RTCDataChannel* channel = | 1349 RTCDataChannel* channel = |
1350 RTCDataChannel::create(getExecutionContext(), wrapUnique(handler)); | 1350 RTCDataChannel::create(getExecutionContext(), wrapUnique(handler)); |
1351 scheduleDispatchEvent(RTCDataChannelEvent::create(EventTypeNames::datachannel, | 1351 scheduleDispatchEvent(RTCDataChannelEvent::create(EventTypeNames::datachannel, |
1352 false, false, channel)); | 1352 false, false, channel)); |
1353 m_hasDataChannels = true; | 1353 m_hasDataChannels = true; |
1354 } | 1354 } |
1355 | 1355 |
1356 void RTCPeerConnection::releasePeerConnectionHandler() { | 1356 void RTCPeerConnection::releasePeerConnectionHandler() { |
1357 stop(); | 1357 contextDestroyed(); |
1358 } | 1358 } |
1359 | 1359 |
1360 void RTCPeerConnection::closePeerConnection() { | 1360 void RTCPeerConnection::closePeerConnection() { |
1361 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); | 1361 DCHECK(m_signalingState != RTCPeerConnection::SignalingStateClosed); |
1362 closeInternal(); | 1362 closeInternal(); |
1363 } | 1363 } |
1364 | 1364 |
1365 const AtomicString& RTCPeerConnection::interfaceName() const { | 1365 const AtomicString& RTCPeerConnection::interfaceName() const { |
1366 return EventTargetNames::RTCPeerConnection; | 1366 return EventTargetNames::RTCPeerConnection; |
1367 } | 1367 } |
1368 | 1368 |
1369 ExecutionContext* RTCPeerConnection::getExecutionContext() const { | 1369 ExecutionContext* RTCPeerConnection::getExecutionContext() const { |
1370 return ActiveDOMObject::getExecutionContext(); | 1370 return ActiveDOMObject::getExecutionContext(); |
1371 } | 1371 } |
1372 | 1372 |
1373 void RTCPeerConnection::suspend() { | 1373 void RTCPeerConnection::suspend() { |
1374 m_dispatchScheduledEventRunner->suspend(); | 1374 m_dispatchScheduledEventRunner->suspend(); |
1375 } | 1375 } |
1376 | 1376 |
1377 void RTCPeerConnection::resume() { | 1377 void RTCPeerConnection::resume() { |
1378 m_dispatchScheduledEventRunner->resume(); | 1378 m_dispatchScheduledEventRunner->resume(); |
1379 } | 1379 } |
1380 | 1380 |
1381 void RTCPeerConnection::stop() { | 1381 void RTCPeerConnection::contextDestroyed() { |
1382 if (m_stopped) | 1382 if (m_stopped) |
1383 return; | 1383 return; |
1384 | 1384 |
1385 m_stopped = true; | 1385 m_stopped = true; |
1386 m_iceConnectionState = ICEConnectionStateClosed; | 1386 m_iceConnectionState = ICEConnectionStateClosed; |
1387 m_signalingState = SignalingStateClosed; | 1387 m_signalingState = SignalingStateClosed; |
1388 | 1388 |
1389 m_dispatchScheduledEventRunner->stop(); | 1389 m_dispatchScheduledEventRunner->stop(); |
1390 | 1390 |
1391 m_peerHandler.reset(); | 1391 m_peerHandler.reset(); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1494 DEFINE_TRACE(RTCPeerConnection) { | 1494 DEFINE_TRACE(RTCPeerConnection) { |
1495 visitor->trace(m_localStreams); | 1495 visitor->trace(m_localStreams); |
1496 visitor->trace(m_remoteStreams); | 1496 visitor->trace(m_remoteStreams); |
1497 visitor->trace(m_dispatchScheduledEventRunner); | 1497 visitor->trace(m_dispatchScheduledEventRunner); |
1498 visitor->trace(m_scheduledEvents); | 1498 visitor->trace(m_scheduledEvents); |
1499 EventTargetWithInlineData::trace(visitor); | 1499 EventTargetWithInlineData::trace(visitor); |
1500 ActiveDOMObject::trace(visitor); | 1500 ActiveDOMObject::trace(visitor); |
1501 } | 1501 } |
1502 | 1502 |
1503 } // namespace blink | 1503 } // namespace blink |
OLD | NEW |