| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Prevent this instance from being collected while it's not in CLOSED | 112 // Prevent this instance from being collected while it's not in CLOSED |
| 113 // state. | 113 // state. |
| 114 virtual bool hasPendingActivity() const override; | 114 virtual bool hasPendingActivity() const override; |
| 115 virtual void suspend() override; | 115 virtual void suspend() override; |
| 116 virtual void resume() override; | 116 virtual void resume() override; |
| 117 virtual void stop() override; | 117 virtual void stop() override; |
| 118 | 118 |
| 119 // WebSocketChannelClient functions. | 119 // WebSocketChannelClient functions. |
| 120 virtual void didConnect(const String& subprotocol, const String& extensions)
override; | 120 virtual void didConnect(const String& subprotocol, const String& extensions)
override; |
| 121 virtual void didReceiveTextMessage(const String& message) override; | 121 virtual void didReceiveTextMessage(const String& message) override; |
| 122 virtual void didReceiveBinaryMessage(PassOwnPtr<Vector<char> >) override; | 122 virtual void didReceiveBinaryMessage(PassOwnPtr<Vector<char>>) override; |
| 123 virtual void didError() override; | 123 virtual void didError() override; |
| 124 virtual void didConsumeBufferedAmount(uint64_t) override; | 124 virtual void didConsumeBufferedAmount(uint64_t) override; |
| 125 virtual void didStartClosingHandshake() override; | 125 virtual void didStartClosingHandshake() override; |
| 126 virtual void didClose(ClosingHandshakeCompletionStatus, unsigned short code,
const String& reason) override; | 126 virtual void didClose(ClosingHandshakeCompletionStatus, unsigned short code,
const String& reason) override; |
| 127 | 127 |
| 128 virtual void trace(Visitor*) override; | 128 virtual void trace(Visitor*) override; |
| 129 | 129 |
| 130 static bool isValidSubprotocolString(const String&); | 130 static bool isValidSubprotocolString(const String&); |
| 131 | 131 |
| 132 protected: | 132 protected: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 explicit EventQueue(EventTarget*); | 165 explicit EventQueue(EventTarget*); |
| 166 | 166 |
| 167 // Dispatches queued events if this queue is active. | 167 // Dispatches queued events if this queue is active. |
| 168 // Does nothing otherwise. | 168 // Does nothing otherwise. |
| 169 void dispatchQueuedEvents(); | 169 void dispatchQueuedEvents(); |
| 170 void resumeTimerFired(Timer<EventQueue>*); | 170 void resumeTimerFired(Timer<EventQueue>*); |
| 171 | 171 |
| 172 State m_state; | 172 State m_state; |
| 173 EventTarget* m_target; | 173 EventTarget* m_target; |
| 174 WillBeHeapDeque<RefPtrWillBeMember<Event> > m_events; | 174 WillBeHeapDeque<RefPtrWillBeMember<Event>> m_events; |
| 175 Timer<EventQueue> m_resumeTimer; | 175 Timer<EventQueue> m_resumeTimer; |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 enum WebSocketSendType { | 178 enum WebSocketSendType { |
| 179 WebSocketSendTypeString, | 179 WebSocketSendTypeString, |
| 180 WebSocketSendTypeArrayBuffer, | 180 WebSocketSendTypeArrayBuffer, |
| 181 WebSocketSendTypeArrayBufferView, | 181 WebSocketSendTypeArrayBufferView, |
| 182 WebSocketSendTypeBlob, | 182 WebSocketSendTypeBlob, |
| 183 WebSocketSendTypeMax, | 183 WebSocketSendTypeMax, |
| 184 }; | 184 }; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 String m_subprotocol; | 224 String m_subprotocol; |
| 225 String m_extensions; | 225 String m_extensions; |
| 226 | 226 |
| 227 Member<EventQueue> m_eventQueue; | 227 Member<EventQueue> m_eventQueue; |
| 228 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; | 228 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; |
| 229 }; | 229 }; |
| 230 | 230 |
| 231 } // namespace blink | 231 } // namespace blink |
| 232 | 232 |
| 233 #endif // DOMWebSocket_h | 233 #endif // DOMWebSocket_h |
| OLD | NEW |