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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef RTCDataChannel_h | 25 #ifndef RTCDataChannel_h |
26 #define RTCDataChannel_h | 26 #define RTCDataChannel_h |
27 | 27 |
28 #include "bindings/v8/ScriptWrappable.h" | 28 #include "bindings/v8/ScriptWrappable.h" |
29 #include "core/events/EventTarget.h" | 29 #include "core/events/EventTarget.h" |
30 #include "heap/Handle.h" | |
31 #include "platform/Timer.h" | 30 #include "platform/Timer.h" |
| 31 #include "platform/heap/Handle.h" |
32 #include "public/platform/WebRTCDataChannelHandler.h" | 32 #include "public/platform/WebRTCDataChannelHandler.h" |
33 #include "public/platform/WebRTCDataChannelHandlerClient.h" | 33 #include "public/platform/WebRTCDataChannelHandlerClient.h" |
34 #include "wtf/RefCounted.h" | 34 #include "wtf/RefCounted.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 class WebRTCDataChannelHandler; | 37 class WebRTCDataChannelHandler; |
38 class WebRTCPeerConnectionHandler; | 38 class WebRTCPeerConnectionHandler; |
39 struct WebRTCDataChannelInit; | 39 struct WebRTCDataChannelInit; |
40 } | 40 } |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 class Blob; | 44 class Blob; |
45 class ExceptionState; | 45 class ExceptionState; |
46 | 46 |
47 class RTCDataChannel FINAL : public RefCounted<RTCDataChannel>, public ScriptWra
ppable, public EventTargetWithInlineData, public blink::WebRTCDataChannelHandler
Client { | 47 class RTCDataChannel FINAL : public RefCountedWillBeRefCountedGarbageCollected<R
TCDataChannel>, public ScriptWrappable, public EventTargetWithInlineData, public
blink::WebRTCDataChannelHandlerClient { |
48 REFCOUNTED_EVENT_TARGET(RTCDataChannel); | 48 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<R
TCDataChannel>); |
49 public: | 49 public: |
50 static PassRefPtr<RTCDataChannel> create(ExecutionContext*, PassOwnPtr<blink
::WebRTCDataChannelHandler>); | 50 static PassRefPtrWillBeRawPtr<RTCDataChannel> create(ExecutionContext*, Pass
OwnPtr<blink::WebRTCDataChannelHandler>); |
51 static PassRefPtr<RTCDataChannel> create(ExecutionContext*, blink::WebRTCPee
rConnectionHandler*, const String& label, const blink::WebRTCDataChannelInit&, E
xceptionState&); | 51 static PassRefPtrWillBeRawPtr<RTCDataChannel> create(ExecutionContext*, blin
k::WebRTCPeerConnectionHandler*, const String& label, const blink::WebRTCDataCha
nnelInit&, ExceptionState&); |
52 virtual ~RTCDataChannel(); | 52 virtual ~RTCDataChannel(); |
53 | 53 |
54 String label() const; | 54 String label() const; |
55 | 55 |
56 // DEPRECATED | 56 // DEPRECATED |
57 bool reliable() const; | 57 bool reliable() const; |
58 | 58 |
59 bool ordered() const; | 59 bool ordered() const; |
60 unsigned short maxRetransmitTime() const; | 60 unsigned short maxRetransmitTime() const; |
61 unsigned short maxRetransmits() const; | 61 unsigned short maxRetransmits() const; |
(...skipping 13 matching lines...) Expand all Loading... |
75 | 75 |
76 void close(); | 76 void close(); |
77 | 77 |
78 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); | 78 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); |
79 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
80 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
81 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
82 | 82 |
83 void stop(); | 83 void stop(); |
84 | 84 |
| 85 void trace(Visitor*); |
| 86 |
85 // EventTarget | 87 // EventTarget |
86 virtual const AtomicString& interfaceName() const OVERRIDE; | 88 virtual const AtomicString& interfaceName() const OVERRIDE; |
87 virtual ExecutionContext* executionContext() const OVERRIDE; | 89 virtual ExecutionContext* executionContext() const OVERRIDE; |
88 | 90 |
89 private: | 91 private: |
90 RTCDataChannel(ExecutionContext*, PassOwnPtr<blink::WebRTCDataChannelHandler
>); | 92 RTCDataChannel(ExecutionContext*, PassOwnPtr<blink::WebRTCDataChannelHandler
>); |
91 | 93 |
92 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 94 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
93 void scheduledEventTimerFired(Timer<RTCDataChannel>*); | 95 void scheduledEventTimerFired(Timer<RTCDataChannel>*); |
94 | 96 |
(...skipping 11 matching lines...) Expand all Loading... |
106 | 108 |
107 blink::WebRTCDataChannelHandlerClient::ReadyState m_readyState; | 109 blink::WebRTCDataChannelHandlerClient::ReadyState m_readyState; |
108 | 110 |
109 enum BinaryType { | 111 enum BinaryType { |
110 BinaryTypeBlob, | 112 BinaryTypeBlob, |
111 BinaryTypeArrayBuffer | 113 BinaryTypeArrayBuffer |
112 }; | 114 }; |
113 BinaryType m_binaryType; | 115 BinaryType m_binaryType; |
114 | 116 |
115 Timer<RTCDataChannel> m_scheduledEventTimer; | 117 Timer<RTCDataChannel> m_scheduledEventTimer; |
116 WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 118 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
117 }; | 119 }; |
118 | 120 |
119 } // namespace WebCore | 121 } // namespace WebCore |
120 | 122 |
121 #endif // RTCDataChannel_h | 123 #endif // RTCDataChannel_h |
OLD | NEW |