| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 118 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
| 119 | 119 |
| 120 // EventTarget functions. | 120 // EventTarget functions. |
| 121 const AtomicString& interfaceName() const override; | 121 const AtomicString& interfaceName() const override; |
| 122 ExecutionContext* getExecutionContext() const override; | 122 ExecutionContext* getExecutionContext() const override; |
| 123 | 123 |
| 124 // ActiveDOMObject functions. | 124 // ActiveDOMObject functions. |
| 125 void contextDestroyed() override; | 125 void contextDestroyed() override; |
| 126 void suspend() override; | 126 void suspend() override; |
| 127 void resume() override; | 127 void resume() override; |
| 128 void stop() override; | |
| 129 | 128 |
| 130 // ScriptWrappable functions. | 129 // ScriptWrappable functions. |
| 131 // Prevent this instance from being collected while it's not in CLOSED | 130 // Prevent this instance from being collected while it's not in CLOSED |
| 132 // state. | 131 // state. |
| 133 bool hasPendingActivity() const final; | 132 bool hasPendingActivity() const final; |
| 134 | 133 |
| 135 // WebSocketChannelClient functions. | 134 // WebSocketChannelClient functions. |
| 136 void didConnect(const String& subprotocol, const String& extensions) override; | 135 void didConnect(const String& subprotocol, const String& extensions) override; |
| 137 void didReceiveTextMessage(const String& message) override; | 136 void didReceiveTextMessage(const String& message) override; |
| 138 void didReceiveBinaryMessage(std::unique_ptr<Vector<char>>) override; | 137 void didReceiveBinaryMessage(std::unique_ptr<Vector<char>>) override; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 161 | 160 |
| 162 // Dispatches the event if this queue is active. | 161 // Dispatches the event if this queue is active. |
| 163 // Queues the event if this queue is suspended. | 162 // Queues the event if this queue is suspended. |
| 164 // Does nothing otherwise. | 163 // Does nothing otherwise. |
| 165 void dispatch(Event* /* event */); | 164 void dispatch(Event* /* event */); |
| 166 | 165 |
| 167 bool isEmpty() const; | 166 bool isEmpty() const; |
| 168 | 167 |
| 169 void suspend(); | 168 void suspend(); |
| 170 void resume(); | 169 void resume(); |
| 171 void stop(); | 170 void contextDestroyed(); |
| 172 | 171 |
| 173 DECLARE_TRACE(); | 172 DECLARE_TRACE(); |
| 174 | 173 |
| 175 private: | 174 private: |
| 176 enum State { | 175 enum State { |
| 177 Active, | 176 Active, |
| 178 Suspended, | 177 Suspended, |
| 179 Stopped, | 178 Stopped, |
| 180 }; | 179 }; |
| 181 | 180 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 String m_subprotocol; | 252 String m_subprotocol; |
| 254 String m_extensions; | 253 String m_extensions; |
| 255 | 254 |
| 256 Member<EventQueue> m_eventQueue; | 255 Member<EventQueue> m_eventQueue; |
| 257 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; | 256 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; |
| 258 }; | 257 }; |
| 259 | 258 |
| 260 } // namespace blink | 259 } // namespace blink |
| 261 | 260 |
| 262 #endif // DOMWebSocket_h | 261 #endif // DOMWebSocket_h |
| OLD | NEW |