| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // without, we have these three signatures. Use of | 82 // without, we have these three signatures. Use of |
| 83 // Optional=DefaultIsUndefined in the IDL file doesn't help for now since | 83 // Optional=DefaultIsUndefined in the IDL file doesn't help for now since |
| 84 // it's bound to a value of 0 which is indistinguishable from the case 0 | 84 // it's bound to a value of 0 which is indistinguishable from the case 0 |
| 85 // is passed as code parameter. | 85 // is passed as code parameter. |
| 86 void close(unsigned short code, const String& reason, ExceptionState&); | 86 void close(unsigned short code, const String& reason, ExceptionState&); |
| 87 void close(ExceptionState&); | 87 void close(ExceptionState&); |
| 88 void close(unsigned short code, ExceptionState&); | 88 void close(unsigned short code, ExceptionState&); |
| 89 | 89 |
| 90 const KURL& url() const; | 90 const KURL& url() const; |
| 91 State readyState() const; | 91 State readyState() const; |
| 92 unsigned long bufferedAmount() const; | 92 unsigned bufferedAmount() const; |
| 93 | 93 |
| 94 String protocol() const; | 94 String protocol() const; |
| 95 String extensions() const; | 95 String extensions() const; |
| 96 | 96 |
| 97 String binaryType() const; | 97 String binaryType() const; |
| 98 void setBinaryType(const String&); | 98 void setBinaryType(const String&); |
| 99 | 99 |
| 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); | 100 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); |
| 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 101 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 102 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 // Handle the JavaScript close method call. close() methods on this class | 195 // Handle the JavaScript close method call. close() methods on this class |
| 196 // are just for determining if the optional code argument is supplied or | 196 // are just for determining if the optional code argument is supplied or |
| 197 // not. | 197 // not. |
| 198 void closeInternal(int, const String&, ExceptionState&); | 198 void closeInternal(int, const String&, ExceptionState&); |
| 199 | 199 |
| 200 size_t getFramingOverhead(size_t payloadSize); | 200 size_t getFramingOverhead(size_t payloadSize); |
| 201 | 201 |
| 202 // Updates m_bufferedAmountAfterClose given the amount of data passed to | 202 // Updates m_bufferedAmountAfterClose given the amount of data passed to |
| 203 // send() method after the state changed to CLOSING or CLOSED. | 203 // send() method after the state changed to CLOSING or CLOSED. |
| 204 void updateBufferedAmountAfterClose(unsigned long); | 204 void updateBufferedAmountAfterClose(unsigned); |
| 205 void reflectBufferedAmountConsumption(Timer<DOMWebSocket>*); | 205 void reflectBufferedAmountConsumption(Timer<DOMWebSocket>*); |
| 206 | 206 |
| 207 void releaseChannel(); | 207 void releaseChannel(); |
| 208 | 208 |
| 209 enum BinaryType { | 209 enum BinaryType { |
| 210 BinaryTypeBlob, | 210 BinaryTypeBlob, |
| 211 BinaryTypeArrayBuffer | 211 BinaryTypeArrayBuffer |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 Member<WebSocketChannel> m_channel; | 214 Member<WebSocketChannel> m_channel; |
| 215 | 215 |
| 216 State m_state; | 216 State m_state; |
| 217 KURL m_url; | 217 KURL m_url; |
| 218 unsigned long m_bufferedAmount; | 218 unsigned m_bufferedAmount; |
| 219 // The consumed buffered amount that will be reflected to m_bufferedAmount | 219 // The consumed buffered amount that will be reflected to m_bufferedAmount |
| 220 // later. It will be cleared once reflected. | 220 // later. It will be cleared once reflected. |
| 221 unsigned long m_consumedBufferedAmount; | 221 unsigned m_consumedBufferedAmount; |
| 222 unsigned long m_bufferedAmountAfterClose; | 222 unsigned m_bufferedAmountAfterClose; |
| 223 BinaryType m_binaryType; | 223 BinaryType m_binaryType; |
| 224 // The subprotocol the server selected. | 224 // The subprotocol the server selected. |
| 225 String m_subprotocol; | 225 String m_subprotocol; |
| 226 String m_extensions; | 226 String m_extensions; |
| 227 | 227 |
| 228 Member<EventQueue> m_eventQueue; | 228 Member<EventQueue> m_eventQueue; |
| 229 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; | 229 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 } // namespace blink | 232 } // namespace blink |
| 233 | 233 |
| 234 #endif // DOMWebSocket_h | 234 #endif // DOMWebSocket_h |
| OLD | NEW |