OLD | NEW |
1 // Copyright (c) 2009 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 // WebSocket live experiment task. | 5 // WebSocket live experiment task. |
6 // It will try the following scenario. | 6 // It will try the following scenario. |
7 // | 7 // |
8 // - Fetch |http_url| within |url_fetch_deadline_ms| msec. | 8 // - Fetch |http_url| within |url_fetch_deadline_ms| msec. |
9 // If failed, the task is aborted (no http reachability) | 9 // If failed, the task is aborted (no http reachability) |
10 // | 10 // |
11 // - Connect to |url| with WebSocket protocol within | 11 // - Connect to |url| with WebSocket protocol within |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 void Run(); | 140 void Run(); |
141 void Cancel(); | 141 void Cancel(); |
142 void SaveResult() const; | 142 void SaveResult() const; |
143 | 143 |
144 const Config& config() const { return config_; } | 144 const Config& config() const { return config_; } |
145 const Result& result() const { return result_; } | 145 const Result& result() const { return result_; } |
146 | 146 |
147 // URLFetcher::Delegate method. | 147 // URLFetcher::Delegate method. |
148 virtual void OnURLFetchComplete(const URLFetcher* source, | 148 virtual void OnURLFetchComplete(const URLFetcher* source, |
149 const GURL& url, | 149 const GURL& url, |
150 const URLRequestStatus& status, | 150 const net::URLRequestStatus& status, |
151 int response_code, | 151 int response_code, |
152 const ResponseCookies& cookies, | 152 const ResponseCookies& cookies, |
153 const std::string& data); | 153 const std::string& data); |
154 | 154 |
155 // net::WebSocketDelegate methods | 155 // net::WebSocketDelegate methods |
156 virtual void OnOpen(net::WebSocket* websocket); | 156 virtual void OnOpen(net::WebSocket* websocket); |
157 virtual void OnMessage(net::WebSocket* websocket, const std::string& msg); | 157 virtual void OnMessage(net::WebSocket* websocket, const std::string& msg); |
158 virtual void OnError(net::WebSocket* websocket); | 158 virtual void OnError(net::WebSocket* websocket); |
159 virtual void OnClose(net::WebSocket* websocket, bool was_clean); | 159 virtual void OnClose(net::WebSocket* websocket, bool was_clean); |
160 virtual void OnSocketError(const net::WebSocket* websocket, int error); | 160 virtual void OnSocketError(const net::WebSocket* websocket, int error); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 base::TimeTicks websocket_connect_start_time_; | 201 base::TimeTicks websocket_connect_start_time_; |
202 base::TimeTicks websocket_echo_start_time_; | 202 base::TimeTicks websocket_echo_start_time_; |
203 base::TimeTicks websocket_idle_start_time_; | 203 base::TimeTicks websocket_idle_start_time_; |
204 | 204 |
205 DISALLOW_COPY_AND_ASSIGN(WebSocketExperimentTask); | 205 DISALLOW_COPY_AND_ASSIGN(WebSocketExperimentTask); |
206 }; | 206 }; |
207 | 207 |
208 } // namespace chrome_browser_net | 208 } // namespace chrome_browser_net |
209 | 209 |
210 #endif // CHROME_BROWSER_NET_WEBSOCKET_EXPERIMENT_WEBSOCKET_EXPERIMENT_TASK_H_ | 210 #endif // CHROME_BROWSER_NET_WEBSOCKET_EXPERIMENT_WEBSOCKET_EXPERIMENT_TASK_H_ |
OLD | NEW |