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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 String binaryType() const; | 95 String binaryType() const; |
96 void setBinaryType(const String&); | 96 void setBinaryType(const String&); |
97 | 97 |
98 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); | 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); |
99 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 99 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
100 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
101 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); | 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
102 | 102 |
103 // EventTarget functions. | 103 // EventTarget functions. |
104 virtual const AtomicString& interfaceName() const OVERRIDE; | 104 virtual const AtomicString& interfaceName() const override; |
105 virtual ExecutionContext* executionContext() const OVERRIDE; | 105 virtual ExecutionContext* executionContext() const override; |
106 | 106 |
107 // ActiveDOMObject functions. | 107 // ActiveDOMObject functions. |
108 virtual void contextDestroyed() OVERRIDE; | 108 virtual void contextDestroyed() override; |
109 // Prevent this instance from being collected while it's not in CLOSED | 109 // Prevent this instance from being collected while it's not in CLOSED |
110 // state. | 110 // state. |
111 virtual bool hasPendingActivity() const OVERRIDE; | 111 virtual bool hasPendingActivity() const override; |
112 virtual void suspend() OVERRIDE; | 112 virtual void suspend() override; |
113 virtual void resume() OVERRIDE; | 113 virtual void resume() override; |
114 virtual void stop() OVERRIDE; | 114 virtual void stop() override; |
115 | 115 |
116 // WebSocketChannelClient functions. | 116 // WebSocketChannelClient functions. |
117 virtual void didConnect(const String& subprotocol, const String& extensions)
OVERRIDE; | 117 virtual void didConnect(const String& subprotocol, const String& extensions)
override; |
118 virtual void didReceiveTextMessage(const String& message) OVERRIDE; | 118 virtual void didReceiveTextMessage(const String& message) override; |
119 virtual void didReceiveBinaryMessage(PassOwnPtr<Vector<char> >) OVERRIDE; | 119 virtual void didReceiveBinaryMessage(PassOwnPtr<Vector<char> >) override; |
120 virtual void didError() OVERRIDE; | 120 virtual void didError() override; |
121 virtual void didConsumeBufferedAmount(unsigned long) OVERRIDE; | 121 virtual void didConsumeBufferedAmount(unsigned long) override; |
122 virtual void didStartClosingHandshake() OVERRIDE; | 122 virtual void didStartClosingHandshake() override; |
123 virtual void didClose(ClosingHandshakeCompletionStatus, unsigned short code,
const String& reason) OVERRIDE; | 123 virtual void didClose(ClosingHandshakeCompletionStatus, unsigned short code,
const String& reason) override; |
124 | 124 |
125 virtual void trace(Visitor*) OVERRIDE; | 125 virtual void trace(Visitor*) override; |
126 | 126 |
127 static bool isValidSubprotocolString(const String&); | 127 static bool isValidSubprotocolString(const String&); |
128 | 128 |
129 protected: | 129 protected: |
130 explicit DOMWebSocket(ExecutionContext*); | 130 explicit DOMWebSocket(ExecutionContext*); |
131 | 131 |
132 private: | 132 private: |
133 // FIXME: This should inherit blink::EventQueue. | 133 // FIXME: This should inherit blink::EventQueue. |
134 class EventQueue FINAL : public GarbageCollectedFinalized<EventQueue> { | 134 class EventQueue final : public GarbageCollectedFinalized<EventQueue> { |
135 public: | 135 public: |
136 static EventQueue* create(EventTarget* target) | 136 static EventQueue* create(EventTarget* target) |
137 { | 137 { |
138 return new EventQueue(target); | 138 return new EventQueue(target); |
139 } | 139 } |
140 ~EventQueue(); | 140 ~EventQueue(); |
141 | 141 |
142 // Dispatches the event if this queue is active. | 142 // Dispatches the event if this queue is active. |
143 // Queues the event if this queue is suspended. | 143 // Queues the event if this queue is suspended. |
144 // Does nothing otherwise. | 144 // Does nothing otherwise. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 String m_subprotocol; | 223 String m_subprotocol; |
224 String m_extensions; | 224 String m_extensions; |
225 | 225 |
226 Member<EventQueue> m_eventQueue; | 226 Member<EventQueue> m_eventQueue; |
227 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; | 227 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; |
228 }; | 228 }; |
229 | 229 |
230 } // namespace blink | 230 } // namespace blink |
231 | 231 |
232 #endif // DOMWebSocket_h | 232 #endif // DOMWebSocket_h |
OLD | NEW |