| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 struct WebRTCDataChannelInit; | 43 struct WebRTCDataChannelInit; |
| 44 | 44 |
| 45 class RTCDataChannel final | 45 class RTCDataChannel final |
| 46 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCDataChannel> | 46 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCDataChannel> |
| 47 , public WebRTCDataChannelHandlerClient { | 47 , public WebRTCDataChannelHandlerClient { |
| 48 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCDataChannel); | 48 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCDataChannel); |
| 49 DEFINE_WRAPPERTYPEINFO(); | 49 DEFINE_WRAPPERTYPEINFO(); |
| 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 ~RTCDataChannel() override; |
| 54 | 54 |
| 55 ReadyState getHandlerState() const; | 55 ReadyState getHandlerState() const; |
| 56 | 56 |
| 57 String label() const; | 57 String label() const; |
| 58 | 58 |
| 59 // DEPRECATED | 59 // DEPRECATED |
| 60 bool reliable() const; | 60 bool reliable() const; |
| 61 | 61 |
| 62 bool ordered() const; | 62 bool ordered() const; |
| 63 unsigned short maxRetransmitTime() const; | 63 unsigned short maxRetransmitTime() const; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 79 void close(); | 79 void close(); |
| 80 | 80 |
| 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); | 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); |
| 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 83 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 83 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
| 84 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 84 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 85 | 85 |
| 86 void stop(); | 86 void stop(); |
| 87 | 87 |
| 88 // EventTarget | 88 // EventTarget |
| 89 virtual const AtomicString& interfaceName() const override; | 89 const AtomicString& interfaceName() const override; |
| 90 virtual ExecutionContext* executionContext() const override; | 90 ExecutionContext* executionContext() const override; |
| 91 | 91 |
| 92 void clearWeakMembers(Visitor*); | 92 void clearWeakMembers(Visitor*); |
| 93 | 93 |
| 94 // Oilpan: need to eagerly finalize m_handler | 94 // Oilpan: need to eagerly finalize m_handler |
| 95 EAGERLY_FINALIZE(); | 95 EAGERLY_FINALIZE(); |
| 96 DECLARE_VIRTUAL_TRACE(); | 96 DECLARE_VIRTUAL_TRACE(); |
| 97 | 97 |
| 98 // WebRTCDataChannelHandlerClient | 98 // WebRTCDataChannelHandlerClient |
| 99 virtual void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState)
override; | 99 void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState) overrid
e; |
| 100 virtual void didReceiveStringData(const WebString&) override; | 100 void didReceiveStringData(const WebString&) override; |
| 101 virtual void didReceiveRawData(const char*, size_t) override; | 101 void didReceiveRawData(const char*, size_t) override; |
| 102 virtual void didDetectError() override; | 102 void didDetectError() override; |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 RTCDataChannel(ExecutionContext*, RTCPeerConnection*, PassOwnPtr<WebRTCDataC
hannelHandler>); | 105 RTCDataChannel(ExecutionContext*, RTCPeerConnection*, PassOwnPtr<WebRTCDataC
hannelHandler>); |
| 106 | 106 |
| 107 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 107 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 108 void scheduledEventTimerFired(Timer<RTCDataChannel>*); | 108 void scheduledEventTimerFired(Timer<RTCDataChannel>*); |
| 109 | 109 |
| 110 RawPtrWillBeMember<ExecutionContext> m_executionContext; | 110 RawPtrWillBeMember<ExecutionContext> m_executionContext; |
| 111 | 111 |
| 112 OwnPtr<WebRTCDataChannelHandler> m_handler; | 112 OwnPtr<WebRTCDataChannelHandler> m_handler; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 123 | 123 |
| 124 Timer<RTCDataChannel> m_scheduledEventTimer; | 124 Timer<RTCDataChannel> m_scheduledEventTimer; |
| 125 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; | 125 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; |
| 126 | 126 |
| 127 WeakMember<RTCPeerConnection> m_connection; | 127 WeakMember<RTCPeerConnection> m_connection; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 } // namespace blink | 130 } // namespace blink |
| 131 | 131 |
| 132 #endif // RTCDataChannel_h | 132 #endif // RTCDataChannel_h |
| OLD | NEW |