OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // WebSocketChannel functions. | 77 // WebSocketChannel functions. |
78 bool connect(const KURL&, const String& protocol) override; | 78 bool connect(const KURL&, const String& protocol) override; |
79 void send(const CString& message) override; | 79 void send(const CString& message) override; |
80 void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength) o
verride; | 80 void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength) o
verride; |
81 void send(PassRefPtr<BlobDataHandle>) override; | 81 void send(PassRefPtr<BlobDataHandle>) override; |
82 void sendTextAsCharVector(PassOwnPtr<Vector<char>> data) override; | 82 void sendTextAsCharVector(PassOwnPtr<Vector<char>> data) override; |
83 void sendBinaryAsCharVector(PassOwnPtr<Vector<char>> data) override; | 83 void sendBinaryAsCharVector(PassOwnPtr<Vector<char>> data) override; |
84 // Start closing handshake. Use the CloseEventCodeNotSpecified for the code | 84 // Start closing handshake. Use the CloseEventCodeNotSpecified for the code |
85 // argument to omit payload. | 85 // argument to omit payload. |
86 void close(int code, const String& reason) override; | 86 void close(int code, const String& reason) override; |
| 87 void changeBinaryType(BinaryType) override; |
87 void fail(const String& reason, MessageLevel, const String&, unsigned lineNu
mber) override; | 88 void fail(const String& reason, MessageLevel, const String&, unsigned lineNu
mber) override; |
88 void disconnect() override; | 89 void disconnect() override; |
89 | 90 |
90 DECLARE_VIRTUAL_TRACE(); | 91 DECLARE_VIRTUAL_TRACE(); |
91 | 92 |
92 private: | 93 private: |
93 enum MessageType { | 94 enum MessageType { |
94 MessageTypeText, | 95 MessageTypeText, |
95 MessageTypeBlob, | 96 MessageTypeBlob, |
96 MessageTypeArrayBuffer, | 97 MessageTypeArrayBuffer, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void abortAsyncOperations(); | 134 void abortAsyncOperations(); |
134 void handleDidClose(bool wasClean, unsigned short code, const String& reason
); | 135 void handleDidClose(bool wasClean, unsigned short code, const String& reason
); |
135 Document* document(); | 136 Document* document(); |
136 | 137 |
137 // WebSocketHandleClient functions. | 138 // WebSocketHandleClient functions. |
138 void didConnect(WebSocketHandle*, const WebString& selectedProtocol, const W
ebString& extensions) override; | 139 void didConnect(WebSocketHandle*, const WebString& selectedProtocol, const W
ebString& extensions) override; |
139 void didStartOpeningHandshake(WebSocketHandle*, const WebSocketHandshakeRequ
estInfo&) override; | 140 void didStartOpeningHandshake(WebSocketHandle*, const WebSocketHandshakeRequ
estInfo&) override; |
140 void didFinishOpeningHandshake(WebSocketHandle*, const WebSocketHandshakeRes
ponseInfo&) override; | 141 void didFinishOpeningHandshake(WebSocketHandle*, const WebSocketHandshakeRes
ponseInfo&) override; |
141 void didFail(WebSocketHandle*, const WebString& message) override; | 142 void didFail(WebSocketHandle*, const WebString& message) override; |
142 void didReceiveData(WebSocketHandle*, bool fin, WebSocketHandle::MessageType
, const char* data, size_t /* size */) override; | 143 void didReceiveData(WebSocketHandle*, bool fin, WebSocketHandle::MessageType
, const char* data, size_t /* size */) override; |
| 144 void didReceiveBlob(WebSocketHandle*, const WebString& uuid, uint64_t size)
override; |
143 void didClose(WebSocketHandle*, bool wasClean, unsigned short code, const We
bString& reason) override; | 145 void didClose(WebSocketHandle*, bool wasClean, unsigned short code, const We
bString& reason) override; |
144 void didReceiveFlowControl(WebSocketHandle*, int64_t quota) override; | 146 void didReceiveFlowControl(WebSocketHandle*, int64_t quota) override; |
145 void didStartClosingHandshake(WebSocketHandle*) override; | 147 void didStartClosingHandshake(WebSocketHandle*) override; |
146 | 148 |
147 // Methods for BlobLoader. | 149 // Methods for BlobLoader. |
148 void didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer>); | 150 void didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer>); |
149 void didFailLoadingBlob(FileError::ErrorCode); | 151 void didFailLoadingBlob(FileError::ErrorCode); |
150 | 152 |
151 // m_handle is a handle of the connection. | 153 // m_handle is a handle of the connection. |
152 // m_handle == 0 means this channel is closed. | 154 // m_handle == 0 means this channel is closed. |
(...skipping 17 matching lines...) Expand all Loading... |
170 String m_sourceURLAtConstruction; | 172 String m_sourceURLAtConstruction; |
171 unsigned m_lineNumberAtConstruction; | 173 unsigned m_lineNumberAtConstruction; |
172 RefPtr<WebSocketHandshakeRequest> m_handshakeRequest; | 174 RefPtr<WebSocketHandshakeRequest> m_handshakeRequest; |
173 | 175 |
174 static const uint64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15; | 176 static const uint64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15; |
175 }; | 177 }; |
176 | 178 |
177 } // namespace blink | 179 } // namespace blink |
178 | 180 |
179 #endif // DocumentWebSocketChannel_h | 181 #endif // DocumentWebSocketChannel_h |
OLD | NEW |