| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef RTCPeerConnection_h | 31 #ifndef RTCPeerConnection_h |
| 32 #define RTCPeerConnection_h | 32 #define RTCPeerConnection_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 34 #include "bindings/core/v8/Dictionary.h" | 35 #include "bindings/core/v8/Dictionary.h" |
| 35 #include "bindings/core/v8/ScriptPromise.h" | 36 #include "bindings/core/v8/ScriptPromise.h" |
| 36 #include "core/dom/ActiveDOMObject.h" | 37 #include "core/dom/ActiveDOMObject.h" |
| 37 #include "modules/EventTargetModules.h" | 38 #include "modules/EventTargetModules.h" |
| 38 #include "modules/crypto/NormalizeAlgorithm.h" | 39 #include "modules/crypto/NormalizeAlgorithm.h" |
| 39 #include "modules/mediastream/MediaStream.h" | 40 #include "modules/mediastream/MediaStream.h" |
| 40 #include "modules/mediastream/RTCIceCandidate.h" | 41 #include "modules/mediastream/RTCIceCandidate.h" |
| 41 #include "platform/AsyncMethodRunner.h" | 42 #include "platform/AsyncMethodRunner.h" |
| 42 #include "public/platform/WebMediaConstraints.h" | 43 #include "public/platform/WebMediaConstraints.h" |
| 43 #include "public/platform/WebRTCPeerConnectionHandler.h" | 44 #include "public/platform/WebRTCPeerConnectionHandler.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 56 class RTCSessionDescription; | 57 class RTCSessionDescription; |
| 57 class RTCSessionDescriptionCallback; | 58 class RTCSessionDescriptionCallback; |
| 58 class RTCSessionDescriptionInit; | 59 class RTCSessionDescriptionInit; |
| 59 class RTCStatsCallback; | 60 class RTCStatsCallback; |
| 60 class ScriptState; | 61 class ScriptState; |
| 61 class VoidCallback; | 62 class VoidCallback; |
| 62 | 63 |
| 63 class RTCPeerConnection final | 64 class RTCPeerConnection final |
| 64 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti
on> | 65 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnecti
on> |
| 65 , public WebRTCPeerConnectionHandlerClient | 66 , public WebRTCPeerConnectionHandlerClient |
| 67 , public ActiveScriptWrappable |
| 66 , public ActiveDOMObject { | 68 , public ActiveDOMObject { |
| 67 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); | 69 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCPeerConnection); |
| 68 DEFINE_WRAPPERTYPEINFO(); | 70 DEFINE_WRAPPERTYPEINFO(); |
| 69 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); | 71 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); |
| 70 public: | 72 public: |
| 71 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com
/565278. | 73 // TODO(hbos): Create with expired RTCCertificate should fail, see crbug.com
/565278. |
| 72 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const
Dictionary&, ExceptionState&); | 74 static RTCPeerConnection* create(ExecutionContext*, const Dictionary&, const
Dictionary&, ExceptionState&); |
| 73 ~RTCPeerConnection() override; | 75 ~RTCPeerConnection() override; |
| 74 | 76 |
| 75 ScriptPromise createOffer(ScriptState*, const RTCOfferOptions&); | 77 ScriptPromise createOffer(ScriptState*, const RTCOfferOptions&); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void closePeerConnection() override; | 146 void closePeerConnection() override; |
| 145 | 147 |
| 146 // EventTarget | 148 // EventTarget |
| 147 const AtomicString& interfaceName() const override; | 149 const AtomicString& interfaceName() const override; |
| 148 ExecutionContext* getExecutionContext() const override; | 150 ExecutionContext* getExecutionContext() const override; |
| 149 | 151 |
| 150 // ActiveDOMObject | 152 // ActiveDOMObject |
| 151 void suspend() override; | 153 void suspend() override; |
| 152 void resume() override; | 154 void resume() override; |
| 153 void stop() override; | 155 void stop() override; |
| 156 |
| 157 // ActiveScriptWrappable |
| 154 // We keep the this object alive until either stopped or closed. | 158 // We keep the this object alive until either stopped or closed. |
| 155 bool hasPendingActivity() const override | 159 bool hasPendingActivity() const final |
| 156 { | 160 { |
| 157 return !m_closed && !m_stopped; | 161 return !m_closed && !m_stopped; |
| 158 } | 162 } |
| 159 | 163 |
| 160 // Oilpan: need to eagerly finalize m_peerHandler | 164 // Oilpan: need to eagerly finalize m_peerHandler |
| 161 EAGERLY_FINALIZE(); | 165 EAGERLY_FINALIZE(); |
| 162 DECLARE_VIRTUAL_TRACE(); | 166 DECLARE_VIRTUAL_TRACE(); |
| 163 | 167 |
| 164 private: | 168 private: |
| 165 typedef Function<bool()> BoolFunction; | 169 typedef Function<bool()> BoolFunction; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner; | 211 Member<AsyncMethodRunner<RTCPeerConnection>> m_dispatchScheduledEventRunner; |
| 208 HeapVector<Member<EventWrapper>> m_scheduledEvents; | 212 HeapVector<Member<EventWrapper>> m_scheduledEvents; |
| 209 | 213 |
| 210 bool m_stopped; | 214 bool m_stopped; |
| 211 bool m_closed; | 215 bool m_closed; |
| 212 }; | 216 }; |
| 213 | 217 |
| 214 } // namespace blink | 218 } // namespace blink |
| 215 | 219 |
| 216 #endif // RTCPeerConnection_h | 220 #endif // RTCPeerConnection_h |
| OLD | NEW |