| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 bool ordered() const; | 62 bool ordered() const; |
| 63 unsigned short maxRetransmitTime() const; | 63 unsigned short maxRetransmitTime() const; |
| 64 unsigned short maxRetransmits() const; | 64 unsigned short maxRetransmits() const; |
| 65 String protocol() const; | 65 String protocol() const; |
| 66 bool negotiated() const; | 66 bool negotiated() const; |
| 67 unsigned short id() const; | 67 unsigned short id() const; |
| 68 String readyState() const; | 68 String readyState() const; |
| 69 unsigned bufferedAmount() const; | 69 unsigned bufferedAmount() const; |
| 70 | 70 |
| 71 unsigned bufferedAmountLowThreshold() const; |
| 72 void setBufferedAmountLowThreshold(unsigned); |
| 73 |
| 71 String binaryType() const; | 74 String binaryType() const; |
| 72 void setBinaryType(const String&, ExceptionState&); | 75 void setBinaryType(const String&, ExceptionState&); |
| 73 | 76 |
| 74 void send(const String&, ExceptionState&); | 77 void send(const String&, ExceptionState&); |
| 75 void send(PassRefPtr<DOMArrayBuffer>, ExceptionState&); | 78 void send(PassRefPtr<DOMArrayBuffer>, ExceptionState&); |
| 76 void send(PassRefPtr<DOMArrayBufferView>, ExceptionState&); | 79 void send(PassRefPtr<DOMArrayBufferView>, ExceptionState&); |
| 77 void send(Blob*, ExceptionState&); | 80 void send(Blob*, ExceptionState&); |
| 78 | 81 |
| 79 void close(); | 82 void close(); |
| 80 | 83 |
| 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); | 84 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); |
| 85 DEFINE_ATTRIBUTE_EVENT_LISTENER(bufferedamountlow); |
| 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 86 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 83 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 87 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
| 84 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 88 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 85 | 89 |
| 86 void stop(); | 90 void stop(); |
| 87 | 91 |
| 88 // EventTarget | 92 // EventTarget |
| 89 virtual const AtomicString& interfaceName() const override; | 93 virtual const AtomicString& interfaceName() const override; |
| 90 virtual ExecutionContext* executionContext() const override; | 94 virtual ExecutionContext* executionContext() const override; |
| 91 | 95 |
| 92 void clearWeakMembers(Visitor*); | 96 void clearWeakMembers(Visitor*); |
| 93 | 97 |
| 94 // Oilpan: need to eagerly finalize m_handler | 98 // Oilpan: need to eagerly finalize m_handler |
| 95 EAGERLY_FINALIZE(); | 99 EAGERLY_FINALIZE(); |
| 96 DECLARE_VIRTUAL_TRACE(); | 100 DECLARE_VIRTUAL_TRACE(); |
| 97 | 101 |
| 98 // WebRTCDataChannelHandlerClient | 102 // WebRTCDataChannelHandlerClient |
| 99 virtual void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState)
override; | 103 virtual void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState)
override; |
| 104 virtual void didDecreaseBufferedAmount(unsigned) override; |
| 100 virtual void didReceiveStringData(const WebString&) override; | 105 virtual void didReceiveStringData(const WebString&) override; |
| 101 virtual void didReceiveRawData(const char*, size_t) override; | 106 virtual void didReceiveRawData(const char*, size_t) override; |
| 102 virtual void didDetectError() override; | 107 virtual void didDetectError() override; |
| 103 | 108 |
| 104 private: | 109 private: |
| 105 RTCDataChannel(ExecutionContext*, RTCPeerConnection*, PassOwnPtr<WebRTCDataC
hannelHandler>); | 110 RTCDataChannel(ExecutionContext*, RTCPeerConnection*, PassOwnPtr<WebRTCDataC
hannelHandler>); |
| 106 | 111 |
| 107 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 112 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
| 108 void scheduledEventTimerFired(Timer<RTCDataChannel>*); | 113 void scheduledEventTimerFired(Timer<RTCDataChannel>*); |
| 109 | 114 |
| 110 RawPtrWillBeMember<ExecutionContext> m_executionContext; | 115 RawPtrWillBeMember<ExecutionContext> m_executionContext; |
| 111 | 116 |
| 112 OwnPtr<WebRTCDataChannelHandler> m_handler; | 117 OwnPtr<WebRTCDataChannelHandler> m_handler; |
| 113 | 118 |
| 114 bool m_stopped; | 119 bool m_stopped; |
| 115 | 120 |
| 116 WebRTCDataChannelHandlerClient::ReadyState m_readyState; | 121 WebRTCDataChannelHandlerClient::ReadyState m_readyState; |
| 117 | 122 |
| 118 enum BinaryType { | 123 enum BinaryType { |
| 119 BinaryTypeBlob, | 124 BinaryTypeBlob, |
| 120 BinaryTypeArrayBuffer | 125 BinaryTypeArrayBuffer |
| 121 }; | 126 }; |
| 122 BinaryType m_binaryType; | 127 BinaryType m_binaryType; |
| 123 | 128 |
| 124 Timer<RTCDataChannel> m_scheduledEventTimer; | 129 Timer<RTCDataChannel> m_scheduledEventTimer; |
| 125 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; | 130 WillBeHeapVector<RefPtrWillBeMember<Event>> m_scheduledEvents; |
| 126 | 131 |
| 127 WeakMember<RTCPeerConnection> m_connection; | 132 WeakMember<RTCPeerConnection> m_connection; |
| 133 |
| 134 unsigned m_bufferedAmountLowThreshold; |
| 135 |
| 136 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h |
| 137 friend class RTCDataChannelTest_BufferedAmountLow_Test; // NOLINT |
| 128 }; | 138 }; |
| 129 | 139 |
| 130 } // namespace blink | 140 } // namespace blink |
| 131 | 141 |
| 132 #endif // RTCDataChannel_h | 142 #endif // RTCDataChannel_h |
| OLD | NEW |