Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: third_party/WebKit/Source/modules/websockets/DOMWebSocket.h

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 Active, 169 Active,
170 Suspended, 170 Suspended,
171 Stopped, 171 Stopped,
172 }; 172 };
173 173
174 explicit EventQueue(EventTarget*); 174 explicit EventQueue(EventTarget*);
175 175
176 // Dispatches queued events if this queue is active. 176 // Dispatches queued events if this queue is active.
177 // Does nothing otherwise. 177 // Does nothing otherwise.
178 void dispatchQueuedEvents(); 178 void dispatchQueuedEvents();
179 void resumeTimerFired(Timer<EventQueue>*); 179 void resumeTimerFired(TimerBase*);
180 180
181 State m_state; 181 State m_state;
182 Member<EventTarget> m_target; 182 Member<EventTarget> m_target;
183 HeapDeque<Member<Event>> m_events; 183 HeapDeque<Member<Event>> m_events;
184 Timer<EventQueue> m_resumeTimer; 184 Timer<EventQueue> m_resumeTimer;
185 }; 185 };
186 186
187 enum WebSocketSendType { 187 enum WebSocketSendType {
188 WebSocketSendTypeString, 188 WebSocketSendTypeString,
189 WebSocketSendTypeArrayBuffer, 189 WebSocketSendTypeArrayBuffer,
(...skipping 20 matching lines...) Expand all
210 void logError(const String& message); 210 void logError(const String& message);
211 211
212 // Handle the JavaScript close method call. close() methods on this class 212 // Handle the JavaScript close method call. close() methods on this class
213 // are just for determining if the optional code argument is supplied or 213 // are just for determining if the optional code argument is supplied or
214 // not. 214 // not.
215 void closeInternal(int, const String&, ExceptionState&); 215 void closeInternal(int, const String&, ExceptionState&);
216 216
217 // Updates m_bufferedAmountAfterClose given the amount of data passed to 217 // Updates m_bufferedAmountAfterClose given the amount of data passed to
218 // send() method after the state changed to CLOSING or CLOSED. 218 // send() method after the state changed to CLOSING or CLOSED.
219 void updateBufferedAmountAfterClose(uint64_t); 219 void updateBufferedAmountAfterClose(uint64_t);
220 void reflectBufferedAmountConsumption(Timer<DOMWebSocket>*); 220 void reflectBufferedAmountConsumption(TimerBase*);
221 221
222 void releaseChannel(); 222 void releaseChannel();
223 void recordSendTypeHistogram(WebSocketSendType); 223 void recordSendTypeHistogram(WebSocketSendType);
224 void recordReceiveTypeHistogram(WebSocketReceiveType); 224 void recordReceiveTypeHistogram(WebSocketReceiveType);
225 225
226 enum BinaryType { 226 enum BinaryType {
227 BinaryTypeBlob, 227 BinaryTypeBlob,
228 BinaryTypeArrayBuffer 228 BinaryTypeArrayBuffer
229 }; 229 };
230 230
(...skipping 11 matching lines...) Expand all
242 String m_subprotocol; 242 String m_subprotocol;
243 String m_extensions; 243 String m_extensions;
244 244
245 Member<EventQueue> m_eventQueue; 245 Member<EventQueue> m_eventQueue;
246 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; 246 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer;
247 }; 247 };
248 248
249 } // namespace blink 249 } // namespace blink
250 250
251 #endif // DOMWebSocket_h 251 #endif // DOMWebSocket_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698