| 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 25 matching lines...) Expand all Loading... |
| 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 class RTCPeerConnection; |
| 46 | 47 |
| 47 class RTCDataChannel FINAL : public RefCountedWillBeRefCountedGarbageCollected<R
TCDataChannel>, public ScriptWrappable, public EventTargetWithInlineData, public
blink::WebRTCDataChannelHandlerClient { | 48 class RTCDataChannel FINAL : public RefCountedWillBeRefCountedGarbageCollected<R
TCDataChannel>, public ScriptWrappable, public EventTargetWithInlineData, public
blink::WebRTCDataChannelHandlerClient { |
| 48 REFCOUNTED_EVENT_TARGET(RTCDataChannel); | 49 REFCOUNTED_EVENT_TARGET(RTCDataChannel); |
| 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCDataChannel); | 50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCDataChannel); |
| 50 public: | 51 public: |
| 51 static PassRefPtrWillBeRawPtr<RTCDataChannel> create(ExecutionContext*, Pass
OwnPtr<blink::WebRTCDataChannelHandler>); | 52 static PassRefPtrWillBeRawPtr<RTCDataChannel> create(ExecutionContext*, RTCP
eerConnection*, PassOwnPtr<blink::WebRTCDataChannelHandler>); |
| 52 static PassRefPtrWillBeRawPtr<RTCDataChannel> create(ExecutionContext*, blin
k::WebRTCPeerConnectionHandler*, const String& label, const blink::WebRTCDataCha
nnelInit&, ExceptionState&); | 53 static PassRefPtrWillBeRawPtr<RTCDataChannel> create(ExecutionContext*, RTCP
eerConnection*, blink::WebRTCPeerConnectionHandler*, const String& label, const
blink::WebRTCDataChannelInit&, ExceptionState&); |
| 53 virtual ~RTCDataChannel(); | 54 virtual ~RTCDataChannel(); |
| 54 | 55 |
| 55 String label() const; | 56 String label() const; |
| 56 | 57 |
| 57 // DEPRECATED | 58 // DEPRECATED |
| 58 bool reliable() const; | 59 bool reliable() const; |
| 59 | 60 |
| 60 bool ordered() const; | 61 bool ordered() const; |
| 61 unsigned short maxRetransmitTime() const; | 62 unsigned short maxRetransmitTime() const; |
| 62 unsigned short maxRetransmits() const; | 63 unsigned short maxRetransmits() const; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
| 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 83 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 83 | 84 |
| 84 void stop(); | 85 void stop(); |
| 85 | 86 |
| 86 // EventTarget | 87 // EventTarget |
| 87 virtual const AtomicString& interfaceName() const OVERRIDE; | 88 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 88 virtual ExecutionContext* executionContext() const OVERRIDE; | 89 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 89 | 90 |
| 91 #if ENABLE(OILPAN) |
| 92 void clearWeakMembers(Visitor*); |
| 93 #endif |
| 94 |
| 90 virtual void trace(Visitor*) OVERRIDE; | 95 virtual void trace(Visitor*) OVERRIDE; |
| 91 | 96 |
| 92 private: | 97 private: |
| 93 RTCDataChannel(ExecutionContext*, PassOwnPtr<blink::WebRTCDataChannelHandler
>); | 98 RTCDataChannel(ExecutionContext*, RTCPeerConnection*, PassOwnPtr<blink::WebR
TCDataChannelHandler>); |
| 94 | 99 |
| 95 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 100 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 96 void scheduledEventTimerFired(Timer<RTCDataChannel>*); | 101 void scheduledEventTimerFired(Timer<RTCDataChannel>*); |
| 97 | 102 |
| 98 ExecutionContext* m_executionContext; | 103 ExecutionContext* m_executionContext; |
| 99 | 104 |
| 100 // blink::WebRTCDataChannelHandlerClient | 105 // blink::WebRTCDataChannelHandlerClient |
| 101 virtual void didChangeReadyState(blink::WebRTCDataChannelHandlerClient::Read
yState) OVERRIDE; | 106 virtual void didChangeReadyState(blink::WebRTCDataChannelHandlerClient::Read
yState) OVERRIDE; |
| 102 virtual void didReceiveStringData(const blink::WebString&) OVERRIDE; | 107 virtual void didReceiveStringData(const blink::WebString&) OVERRIDE; |
| 103 virtual void didReceiveRawData(const char*, size_t) OVERRIDE; | 108 virtual void didReceiveRawData(const char*, size_t) OVERRIDE; |
| 104 virtual void didDetectError() OVERRIDE; | 109 virtual void didDetectError() OVERRIDE; |
| 105 | 110 |
| 106 OwnPtr<blink::WebRTCDataChannelHandler> m_handler; | 111 OwnPtr<blink::WebRTCDataChannelHandler> m_handler; |
| 107 | 112 |
| 108 bool m_stopped; | 113 bool m_stopped; |
| 109 | 114 |
| 110 blink::WebRTCDataChannelHandlerClient::ReadyState m_readyState; | 115 blink::WebRTCDataChannelHandlerClient::ReadyState m_readyState; |
| 111 | 116 |
| 112 enum BinaryType { | 117 enum BinaryType { |
| 113 BinaryTypeBlob, | 118 BinaryTypeBlob, |
| 114 BinaryTypeArrayBuffer | 119 BinaryTypeArrayBuffer |
| 115 }; | 120 }; |
| 116 BinaryType m_binaryType; | 121 BinaryType m_binaryType; |
| 117 | 122 |
| 118 Timer<RTCDataChannel> m_scheduledEventTimer; | 123 Timer<RTCDataChannel> m_scheduledEventTimer; |
| 119 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 124 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
| 125 |
| 126 #if ENABLE(OILPAN) |
| 127 WeakMember<RTCPeerConnection> m_connection; |
| 128 #endif |
| 120 }; | 129 }; |
| 121 | 130 |
| 122 } // namespace WebCore | 131 } // namespace WebCore |
| 123 | 132 |
| 124 #endif // RTCDataChannel_h | 133 #endif // RTCDataChannel_h |
| OLD | NEW |