Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_JOB_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_JOB_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_JOB_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_JOB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 INITIALIZED = -1, | 36 INITIALIZED = -1, |
| 37 CONNECTING = 0, | 37 CONNECTING = 0, |
| 38 OPEN = 1, | 38 OPEN = 1, |
| 39 CLOSING = 2, | 39 CLOSING = 2, |
| 40 CLOSED = 3, | 40 CLOSED = 3, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 explicit WebSocketJob(SocketStream::Delegate* delegate); | 43 explicit WebSocketJob(SocketStream::Delegate* delegate); |
| 44 | 44 |
| 45 static void EnsureInit(); | 45 static void EnsureInit(); |
| 46 static void EnableWebSocketOverSpdy(bool enable); | |
|
Yuta Kitamura
2011/05/20 02:59:48
I'd suggest:
set_websocket_over_spdy_enabled(boo
Takashi Toyoshima
2011/05/20 05:25:40
Done.
Also, I added comments.
| |
| 46 | 47 |
| 47 State state() const { return state_; } | 48 State state() const { return state_; } |
| 48 virtual void Connect(); | 49 virtual void Connect(); |
| 49 virtual bool SendData(const char* data, int len); | 50 virtual bool SendData(const char* data, int len); |
| 50 virtual void Close(); | 51 virtual void Close(); |
| 51 virtual void RestartWithAuth( | 52 virtual void RestartWithAuth( |
| 52 const string16& username, | 53 const string16& username, |
| 53 const string16& password); | 54 const string16& password); |
| 54 virtual void DetachDelegate(); | 55 virtual void DetachDelegate(); |
| 55 | 56 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 85 GURL GetURLForCookies() const; | 86 GURL GetURLForCookies() const; |
| 86 | 87 |
| 87 const AddressList& address_list() const; | 88 const AddressList& address_list() const; |
| 88 void SetWaiting(); | 89 void SetWaiting(); |
| 89 bool IsWaiting() const; | 90 bool IsWaiting() const; |
| 90 void Wakeup(); | 91 void Wakeup(); |
| 91 void DoCallback(); | 92 void DoCallback(); |
| 92 | 93 |
| 93 void SendPending(); | 94 void SendPending(); |
| 94 | 95 |
| 96 static bool websocket_over_spdy_; | |
|
Yuta Kitamura
2011/05/20 02:59:48
I'd suggest: "websocket_over_spdy_enabled_";
Takashi Toyoshima
2011/05/20 05:25:40
Done.
| |
| 97 | |
| 95 SocketStream::Delegate* delegate_; | 98 SocketStream::Delegate* delegate_; |
| 96 State state_; | 99 State state_; |
| 97 bool waiting_; | 100 bool waiting_; |
| 98 AddressList addresses_; | 101 AddressList addresses_; |
| 99 CompletionCallback* callback_; // for throttling. | 102 CompletionCallback* callback_; // for throttling. |
| 100 | 103 |
| 101 scoped_ptr<WebSocketHandshakeRequestHandler> handshake_request_; | 104 scoped_ptr<WebSocketHandshakeRequestHandler> handshake_request_; |
| 102 scoped_ptr<WebSocketHandshakeResponseHandler> handshake_response_; | 105 scoped_ptr<WebSocketHandshakeResponseHandler> handshake_response_; |
| 103 | 106 |
| 104 size_t handshake_request_sent_; | 107 size_t handshake_request_sent_; |
| 105 | 108 |
| 106 std::vector<std::string> response_cookies_; | 109 std::vector<std::string> response_cookies_; |
| 107 size_t response_cookies_save_index_; | 110 size_t response_cookies_save_index_; |
| 108 | 111 |
| 109 scoped_ptr<WebSocketFrameHandler> send_frame_handler_; | 112 scoped_ptr<WebSocketFrameHandler> send_frame_handler_; |
| 110 scoped_refptr<DrainableIOBuffer> current_buffer_; | 113 scoped_refptr<DrainableIOBuffer> current_buffer_; |
| 111 scoped_ptr<WebSocketFrameHandler> receive_frame_handler_; | 114 scoped_ptr<WebSocketFrameHandler> receive_frame_handler_; |
| 112 | 115 |
| 113 DISALLOW_COPY_AND_ASSIGN(WebSocketJob); | 116 DISALLOW_COPY_AND_ASSIGN(WebSocketJob); |
| 114 }; | 117 }; |
| 115 | 118 |
| 116 } // namespace | 119 } // namespace |
| 117 | 120 |
| 118 #endif // NET_WEBSOCKETS_WEBSOCKET_JOB_H_ | 121 #endif // NET_WEBSOCKETS_WEBSOCKET_JOB_H_ |
| OLD | NEW |