OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/peerconnection/RTCSessionDescriptionRequestPromiseImpl.h" | 5 #include "modules/peerconnection/RTCSessionDescriptionRequestPromiseImpl.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 #include "modules/peerconnection/RTCPeerConnection.h" | 10 #include "modules/peerconnection/RTCPeerConnection.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 RTCSessionDescriptionRequestPromiseImpl::RTCSessionDescriptionRequestPromiseImpl
(RTCPeerConnection* requester, ScriptPromiseResolver* resolver) | 21 RTCSessionDescriptionRequestPromiseImpl::RTCSessionDescriptionRequestPromiseImpl
(RTCPeerConnection* requester, ScriptPromiseResolver* resolver) |
22 : m_requester(requester) | 22 : m_requester(requester) |
23 , m_resolver(resolver) | 23 , m_resolver(resolver) |
24 { | 24 { |
25 DCHECK(m_requester); | 25 DCHECK(m_requester); |
26 DCHECK(m_resolver); | 26 DCHECK(m_resolver); |
27 } | 27 } |
28 | 28 |
29 RTCSessionDescriptionRequestPromiseImpl::~RTCSessionDescriptionRequestPromiseImp
l() | 29 RTCSessionDescriptionRequestPromiseImpl::~RTCSessionDescriptionRequestPromiseImp
l() |
30 { | 30 { |
31 DCHECK(!m_requester); | |
32 } | 31 } |
33 | 32 |
34 void RTCSessionDescriptionRequestPromiseImpl::requestSucceeded(const WebRTCSessi
onDescription& webSessionDescription) | 33 void RTCSessionDescriptionRequestPromiseImpl::requestSucceeded(const WebRTCSessi
onDescription& webSessionDescription) |
35 { | 34 { |
36 if (m_requester && m_requester->shouldFireDefaultCallbacks()) { | 35 if (m_requester && m_requester->shouldFireDefaultCallbacks()) { |
37 m_resolver->resolve(RTCSessionDescription::create(webSessionDescription)
); | 36 m_resolver->resolve(RTCSessionDescription::create(webSessionDescription)
); |
38 } else { | 37 } else { |
39 // This is needed to have the resolver release its internal resources | 38 // This is needed to have the resolver release its internal resources |
40 // while leaving the associated promise pending as specified. | 39 // while leaving the associated promise pending as specified. |
41 m_resolver->detach(); | 40 m_resolver->detach(); |
(...skipping 22 matching lines...) Expand all Loading... |
64 } | 63 } |
65 | 64 |
66 DEFINE_TRACE(RTCSessionDescriptionRequestPromiseImpl) | 65 DEFINE_TRACE(RTCSessionDescriptionRequestPromiseImpl) |
67 { | 66 { |
68 visitor->trace(m_resolver); | 67 visitor->trace(m_resolver); |
69 visitor->trace(m_requester); | 68 visitor->trace(m_requester); |
70 RTCSessionDescriptionRequest::trace(visitor); | 69 RTCSessionDescriptionRequest::trace(visitor); |
71 } | 70 } |
72 | 71 |
73 } // namespace blink | 72 } // namespace blink |
OLD | NEW |