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

Side by Side Diff: net/http/http_network_transaction.h

Issue 23856018: Changes to HttpNetworkTransaction for WebSocket Handshake (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add tests by yhirano Created 7 years, 1 month 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_HTTP_HTTP_NETWORK_TRANSACTION_H_ 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "net/base/net_log.h" 15 #include "net/base/net_log.h"
16 #include "net/base/request_priority.h" 16 #include "net/base/request_priority.h"
17 #include "net/http/http_auth.h" 17 #include "net/http/http_auth.h"
18 #include "net/http/http_request_headers.h" 18 #include "net/http/http_request_headers.h"
19 #include "net/http/http_response_info.h" 19 #include "net/http/http_response_info.h"
20 #include "net/http/http_stream_factory.h" 20 #include "net/http/http_stream_factory.h"
21 #include "net/http/http_transaction.h" 21 #include "net/http/http_transaction.h"
22 #include "net/proxy/proxy_service.h" 22 #include "net/proxy/proxy_service.h"
23 #include "net/ssl/ssl_config_service.h" 23 #include "net/ssl/ssl_config_service.h"
24 #include "net/websockets/websocket_handshake_stream_base.h"
24 25
25 namespace net { 26 namespace net {
26 27
27 class ClientSocketHandle; 28 class ClientSocketHandle;
28 class HttpAuthController; 29 class HttpAuthController;
29 class HttpNetworkSession; 30 class HttpNetworkSession;
30 class HttpStreamBase; 31 class HttpStreamBase;
31 class HttpStreamRequest; 32 class HttpStreamRequest;
32 class IOBuffer; 33 class IOBuffer;
33 class SpdySession; 34 class SpdySession;
(...skipping 27 matching lines...) Expand all
61 virtual void StopCaching() OVERRIDE {} 62 virtual void StopCaching() OVERRIDE {}
62 virtual bool GetFullRequestHeaders( 63 virtual bool GetFullRequestHeaders(
63 HttpRequestHeaders* headers) const OVERRIDE; 64 HttpRequestHeaders* headers) const OVERRIDE;
64 virtual void DoneReading() OVERRIDE {} 65 virtual void DoneReading() OVERRIDE {}
65 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; 66 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE;
66 virtual LoadState GetLoadState() const OVERRIDE; 67 virtual LoadState GetLoadState() const OVERRIDE;
67 virtual UploadProgress GetUploadProgress() const OVERRIDE; 68 virtual UploadProgress GetUploadProgress() const OVERRIDE;
68 virtual bool GetLoadTimingInfo( 69 virtual bool GetLoadTimingInfo(
69 LoadTimingInfo* load_timing_info) const OVERRIDE; 70 LoadTimingInfo* load_timing_info) const OVERRIDE;
70 virtual void SetPriority(RequestPriority priority) OVERRIDE; 71 virtual void SetPriority(RequestPriority priority) OVERRIDE;
72 virtual void SetWebSocketHandshakeStreamFactory(
73 WebSocketHandshakeStreamBase::Factory* factory) OVERRIDE;
71 74
72 // HttpStreamRequest::Delegate methods: 75 // HttpStreamRequest::Delegate methods:
73 virtual void OnStreamReady(const SSLConfig& used_ssl_config, 76 virtual void OnStreamReady(const SSLConfig& used_ssl_config,
74 const ProxyInfo& used_proxy_info, 77 const ProxyInfo& used_proxy_info,
75 HttpStreamBase* stream) OVERRIDE; 78 HttpStreamBase* stream) OVERRIDE;
76 virtual void OnWebSocketHandshakeStreamReady( 79 virtual void OnWebSocketHandshakeStreamReady(
77 const SSLConfig& used_ssl_config, 80 const SSLConfig& used_ssl_config,
78 const ProxyInfo& used_proxy_info, 81 const ProxyInfo& used_proxy_info,
79 WebSocketHandshakeStreamBase* stream) OVERRIDE; 82 WebSocketHandshakeStreamBase* stream) OVERRIDE;
80 virtual void OnStreamFailed(int status, 83 virtual void OnStreamFailed(int status,
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 base::TimeTicks send_start_time_; 302 base::TimeTicks send_start_time_;
300 base::TimeTicks send_end_time_; 303 base::TimeTicks send_end_time_;
301 304
302 // The next state in the state machine. 305 // The next state in the state machine.
303 State next_state_; 306 State next_state_;
304 307
305 // True when the tunnel is in the process of being established - we can't 308 // True when the tunnel is in the process of being established - we can't
306 // read from the socket until the tunnel is done. 309 // read from the socket until the tunnel is done.
307 bool establishing_tunnel_; 310 bool establishing_tunnel_;
308 311
312 // The factory to use to create WebSocketHandshakeStreamBase objects. Only
313 // relevant when establishing a WebSocket connection.
314 WebSocketHandshakeStreamBase::Factory*
315 websocket_handshake_stream_base_factory_;
316
309 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); 317 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction);
310 }; 318 };
311 319
312 } // namespace net 320 } // namespace net
313 321
314 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ 322 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698