| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 document->frame()->loader()->client()->dispatchWillStartUsingPeerConnectionH
andler(m_peerHandler.get()); | 156 document->frame()->loader()->client()->dispatchWillStartUsingPeerConnectionH
andler(m_peerHandler.get()); |
| 157 | 157 |
| 158 if (!m_peerHandler->initialize(configuration, constraints)) { | 158 if (!m_peerHandler->initialize(configuration, constraints)) { |
| 159 ec = NOT_SUPPORTED_ERR; | 159 ec = NOT_SUPPORTED_ERR; |
| 160 return; | 160 return; |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 | 163 |
| 164 RTCPeerConnection::~RTCPeerConnection() | 164 RTCPeerConnection::~RTCPeerConnection() |
| 165 { | 165 { |
| 166 stop(); |
| 166 } | 167 } |
| 167 | 168 |
| 168 void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> su
ccessCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& med
iaConstraints, ExceptionCode& ec) | 169 void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> su
ccessCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& med
iaConstraints, ExceptionCode& ec) |
| 169 { | 170 { |
| 170 if (m_readyState == ReadyStateClosed) { | 171 if (m_readyState == ReadyStateClosed) { |
| 171 ec = INVALID_STATE_ERR; | 172 ec = INVALID_STATE_ERR; |
| 172 return; | 173 return; |
| 173 } | 174 } |
| 174 | 175 |
| 175 if (!successCallback) { | 176 if (!successCallback) { |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 return eventNames().interfaceForRTCPeerConnection; | 559 return eventNames().interfaceForRTCPeerConnection; |
| 559 } | 560 } |
| 560 | 561 |
| 561 ScriptExecutionContext* RTCPeerConnection::scriptExecutionContext() const | 562 ScriptExecutionContext* RTCPeerConnection::scriptExecutionContext() const |
| 562 { | 563 { |
| 563 return ActiveDOMObject::scriptExecutionContext(); | 564 return ActiveDOMObject::scriptExecutionContext(); |
| 564 } | 565 } |
| 565 | 566 |
| 566 void RTCPeerConnection::stop() | 567 void RTCPeerConnection::stop() |
| 567 { | 568 { |
| 569 if (m_stopped) |
| 570 return; |
| 571 |
| 568 m_stopped = true; | 572 m_stopped = true; |
| 569 m_iceState = IceStateClosed; | 573 m_iceState = IceStateClosed; |
| 570 m_readyState = ReadyStateClosed; | 574 m_readyState = ReadyStateClosed; |
| 571 | 575 |
| 572 Vector<RefPtr<RTCDataChannel> >::iterator i = m_dataChannels.begin(); | 576 Vector<RefPtr<RTCDataChannel> >::iterator i = m_dataChannels.begin(); |
| 573 for (; i != m_dataChannels.end(); ++i) | 577 for (; i != m_dataChannels.end(); ++i) |
| 574 (*i)->stop(); | 578 (*i)->stop(); |
| 575 } | 579 } |
| 576 | 580 |
| 577 EventTargetData* RTCPeerConnection::eventTargetData() | 581 EventTargetData* RTCPeerConnection::eventTargetData() |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 Vector<RefPtr<Event> >::iterator it = events.begin(); | 634 Vector<RefPtr<Event> >::iterator it = events.begin(); |
| 631 for (; it != events.end(); ++it) | 635 for (; it != events.end(); ++it) |
| 632 dispatchEvent((*it).release()); | 636 dispatchEvent((*it).release()); |
| 633 | 637 |
| 634 events.clear(); | 638 events.clear(); |
| 635 } | 639 } |
| 636 | 640 |
| 637 } // namespace WebCore | 641 } // namespace WebCore |
| 638 | 642 |
| 639 #endif // ENABLE(MEDIA_STREAM) | 643 #endif // ENABLE(MEDIA_STREAM) |
| OLD | NEW |