| 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 26 matching lines...) Expand all Loading... |
| 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 REFCOUNTED_EVENT_TARGET(RTCDataChannel); |
| 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RTCDataChannel); |
| 49 public: | 50 public: |
| 50 static PassRefPtr<RTCDataChannel> create(ExecutionContext*, PassOwnPtr<blink
::WebRTCDataChannelHandler>); | 51 static PassRefPtr<RTCDataChannel> create(ExecutionContext*, PassOwnPtr<blink
::WebRTCDataChannelHandler>); |
| 51 static PassRefPtr<RTCDataChannel> create(ExecutionContext*, blink::WebRTCPee
rConnectionHandler*, const String& label, const blink::WebRTCDataChannelInit&, E
xceptionState&); | 52 static PassRefPtr<RTCDataChannel> create(ExecutionContext*, blink::WebRTCPee
rConnectionHandler*, const String& label, const blink::WebRTCDataChannelInit&, E
xceptionState&); |
| 52 virtual ~RTCDataChannel(); | 53 virtual ~RTCDataChannel(); |
| 53 | 54 |
| 54 String label() const; | 55 String label() const; |
| 55 | 56 |
| 56 // DEPRECATED | 57 // DEPRECATED |
| 57 bool reliable() const; | 58 bool reliable() const; |
| 58 | 59 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
| 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 82 | 83 |
| 83 void stop(); | 84 void stop(); |
| 84 | 85 |
| 85 // EventTarget | 86 // EventTarget |
| 86 virtual const AtomicString& interfaceName() const OVERRIDE; | 87 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 87 virtual ExecutionContext* executionContext() const OVERRIDE; | 88 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 88 | 89 |
| 90 virtual void trace(Visitor*) OVERRIDE; |
| 91 |
| 89 private: | 92 private: |
| 90 RTCDataChannel(ExecutionContext*, PassOwnPtr<blink::WebRTCDataChannelHandler
>); | 93 RTCDataChannel(ExecutionContext*, PassOwnPtr<blink::WebRTCDataChannelHandler
>); |
| 91 | 94 |
| 92 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 95 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 93 void scheduledEventTimerFired(Timer<RTCDataChannel>*); | 96 void scheduledEventTimerFired(Timer<RTCDataChannel>*); |
| 94 | 97 |
| 95 ExecutionContext* m_executionContext; | 98 ExecutionContext* m_executionContext; |
| 96 | 99 |
| 97 // blink::WebRTCDataChannelHandlerClient | 100 // blink::WebRTCDataChannelHandlerClient |
| 98 virtual void didChangeReadyState(blink::WebRTCDataChannelHandlerClient::Read
yState) OVERRIDE; | 101 virtual void didChangeReadyState(blink::WebRTCDataChannelHandlerClient::Read
yState) OVERRIDE; |
| 99 virtual void didReceiveStringData(const blink::WebString&) OVERRIDE; | 102 virtual void didReceiveStringData(const blink::WebString&) OVERRIDE; |
| 100 virtual void didReceiveRawData(const char*, size_t) OVERRIDE; | 103 virtual void didReceiveRawData(const char*, size_t) OVERRIDE; |
| 101 virtual void didDetectError() OVERRIDE; | 104 virtual void didDetectError() OVERRIDE; |
| 102 | 105 |
| 103 OwnPtr<blink::WebRTCDataChannelHandler> m_handler; | 106 OwnPtr<blink::WebRTCDataChannelHandler> m_handler; |
| 104 | 107 |
| 105 bool m_stopped; | 108 bool m_stopped; |
| 106 | 109 |
| 107 blink::WebRTCDataChannelHandlerClient::ReadyState m_readyState; | 110 blink::WebRTCDataChannelHandlerClient::ReadyState m_readyState; |
| 108 | 111 |
| 109 enum BinaryType { | 112 enum BinaryType { |
| 110 BinaryTypeBlob, | 113 BinaryTypeBlob, |
| 111 BinaryTypeArrayBuffer | 114 BinaryTypeArrayBuffer |
| 112 }; | 115 }; |
| 113 BinaryType m_binaryType; | 116 BinaryType m_binaryType; |
| 114 | 117 |
| 115 Timer<RTCDataChannel> m_scheduledEventTimer; | 118 Timer<RTCDataChannel> m_scheduledEventTimer; |
| 116 WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 119 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
| 117 }; | 120 }; |
| 118 | 121 |
| 119 } // namespace WebCore | 122 } // namespace WebCore |
| 120 | 123 |
| 121 #endif // RTCDataChannel_h | 124 #endif // RTCDataChannel_h |
| OLD | NEW |