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 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class Blob; | 36 class Blob; |
37 class ExceptionState; | 37 class ExceptionState; |
38 class RTCPeerConnection; | 38 class RTCPeerConnection; |
39 class WebRTCDataChannelHandler; | 39 class WebRTCDataChannelHandler; |
40 class WebRTCPeerConnectionHandler; | 40 class WebRTCPeerConnectionHandler; |
41 struct WebRTCDataChannelInit; | 41 struct WebRTCDataChannelInit; |
42 | 42 |
43 class RTCDataChannel FINAL | 43 class RTCDataChannel final |
44 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<RTCDataCh
annel> | 44 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<RTCDataCh
annel> |
45 , public EventTargetWithInlineData | 45 , public EventTargetWithInlineData |
46 , public WebRTCDataChannelHandlerClient { | 46 , public WebRTCDataChannelHandlerClient { |
47 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollectedWi
llBeGarbageCollectedFinalized<RTCDataChannel>); | 47 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollectedWi
llBeGarbageCollectedFinalized<RTCDataChannel>); |
48 DEFINE_WRAPPERTYPEINFO(); | 48 DEFINE_WRAPPERTYPEINFO(); |
49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCDataChannel); | 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCDataChannel); |
50 public: | 50 public: |
51 static RTCDataChannel* create(ExecutionContext*, RTCPeerConnection*, PassOwn
Ptr<WebRTCDataChannelHandler>); | 51 static RTCDataChannel* create(ExecutionContext*, RTCPeerConnection*, PassOwn
Ptr<WebRTCDataChannelHandler>); |
52 static RTCDataChannel* create(ExecutionContext*, RTCPeerConnection*, WebRTCP
eerConnectionHandler*, const String& label, const WebRTCDataChannelInit&, Except
ionState&); | 52 static RTCDataChannel* create(ExecutionContext*, RTCPeerConnection*, WebRTCP
eerConnectionHandler*, const String& label, const WebRTCDataChannelInit&, Except
ionState&); |
53 virtual ~RTCDataChannel(); | 53 virtual ~RTCDataChannel(); |
(...skipping 23 matching lines...) Expand all Loading... |
77 void close(); | 77 void close(); |
78 | 78 |
79 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); | 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); |
80 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
81 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
82 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
83 | 83 |
84 void stop(); | 84 void stop(); |
85 | 85 |
86 // EventTarget | 86 // EventTarget |
87 virtual const AtomicString& interfaceName() const OVERRIDE; | 87 virtual const AtomicString& interfaceName() const override; |
88 virtual ExecutionContext* executionContext() const OVERRIDE; | 88 virtual ExecutionContext* executionContext() const override; |
89 | 89 |
90 void clearWeakMembers(Visitor*); | 90 void clearWeakMembers(Visitor*); |
91 virtual void trace(Visitor*) OVERRIDE; | 91 virtual void trace(Visitor*) override; |
92 | 92 |
93 private: | 93 private: |
94 RTCDataChannel(ExecutionContext*, RTCPeerConnection*, PassOwnPtr<WebRTCDataC
hannelHandler>); | 94 RTCDataChannel(ExecutionContext*, RTCPeerConnection*, PassOwnPtr<WebRTCDataC
hannelHandler>); |
95 | 95 |
96 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 96 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
97 void scheduledEventTimerFired(Timer<RTCDataChannel>*); | 97 void scheduledEventTimerFired(Timer<RTCDataChannel>*); |
98 | 98 |
99 ExecutionContext* m_executionContext; | 99 ExecutionContext* m_executionContext; |
100 | 100 |
101 // WebRTCDataChannelHandlerClient | 101 // WebRTCDataChannelHandlerClient |
102 virtual void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState)
OVERRIDE; | 102 virtual void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState)
override; |
103 virtual void didReceiveStringData(const WebString&) OVERRIDE; | 103 virtual void didReceiveStringData(const WebString&) override; |
104 virtual void didReceiveRawData(const char*, size_t) OVERRIDE; | 104 virtual void didReceiveRawData(const char*, size_t) override; |
105 virtual void didDetectError() OVERRIDE; | 105 virtual void didDetectError() override; |
106 | 106 |
107 OwnPtr<WebRTCDataChannelHandler> m_handler; | 107 OwnPtr<WebRTCDataChannelHandler> m_handler; |
108 | 108 |
109 bool m_stopped; | 109 bool m_stopped; |
110 | 110 |
111 WebRTCDataChannelHandlerClient::ReadyState m_readyState; | 111 WebRTCDataChannelHandlerClient::ReadyState m_readyState; |
112 | 112 |
113 enum BinaryType { | 113 enum BinaryType { |
114 BinaryTypeBlob, | 114 BinaryTypeBlob, |
115 BinaryTypeArrayBuffer | 115 BinaryTypeArrayBuffer |
116 }; | 116 }; |
117 BinaryType m_binaryType; | 117 BinaryType m_binaryType; |
118 | 118 |
119 Timer<RTCDataChannel> m_scheduledEventTimer; | 119 Timer<RTCDataChannel> m_scheduledEventTimer; |
120 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 120 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
121 | 121 |
122 WeakMember<RTCPeerConnection> m_connection; | 122 WeakMember<RTCPeerConnection> m_connection; |
123 }; | 123 }; |
124 | 124 |
125 } // namespace blink | 125 } // namespace blink |
126 | 126 |
127 #endif // RTCDataChannel_h | 127 #endif // RTCDataChannel_h |
OLD | NEW |