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

Side by Side Diff: net/spdy/spdy_proxy_client_socket.h

Issue 4935001: Allow a non-200 (or non-407) response for a CONNECT request from an HTTPS pro... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Cleaned up Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ 5 #ifndef NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_
6 #define NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ 6 #define NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <list> 10 #include <list>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/ref_counted.h" 13 #include "base/ref_counted.h"
14 #include "net/base/completion_callback.h" 14 #include "net/base/completion_callback.h"
15 #include "net/base/host_port_pair.h" 15 #include "net/base/host_port_pair.h"
16 #include "net/base/net_log.h" 16 #include "net/base/net_log.h"
17 #include "net/http/http_auth_controller.h" 17 #include "net/http/http_auth_controller.h"
18 #include "net/http/http_proxy_tunnel_client_socket.h"
18 #include "net/http/http_request_headers.h" 19 #include "net/http/http_request_headers.h"
19 #include "net/http/http_request_info.h" 20 #include "net/http/http_request_info.h"
20 #include "net/http/http_response_info.h" 21 #include "net/http/http_response_info.h"
21 #include "net/socket/client_socket.h" 22 #include "net/spdy/spdy_http_stream.h"
22 #include "net/spdy/spdy_protocol.h" 23 #include "net/spdy/spdy_protocol.h"
23 #include "net/spdy/spdy_session.h" 24 #include "net/spdy/spdy_session.h"
24 #include "net/spdy/spdy_stream.h" 25 #include "net/spdy/spdy_stream.h"
25 26
26 27
27 class GURL; 28 class GURL;
28 29
29 namespace net { 30 namespace net {
30 31
31 class AddressList; 32 class AddressList;
32 class ClientSocketHandle; 33 class ClientSocketHandle;
33 class HttpStream; 34 class HttpStream;
34 class IOBuffer; 35 class IOBuffer;
35 class SpdySession; 36 class SpdySession;
36 class SpdyStream; 37 class SpdyStream;
37 38
38 class SpdyProxyClientSocket : public ClientSocket, public SpdyStream::Delegate { 39 class SpdyProxyClientSocket : public HttpProxyTunnelClientSocket,
40 public SpdyStream::Delegate {
39 public: 41 public:
40 // Create a socket on top of the |spdy_stream| by sending a SYN_STREAM 42 // Create a socket on top of the |spdy_stream| by sending a SYN_STREAM
41 // CONNECT frame for |endpoint|. After the SYN_REPLY is received, 43 // CONNECT frame for |endpoint|. After the SYN_REPLY is received,
42 // any data read/written to the socket will be transferred in data 44 // any data read/written to the socket will be transferred in data
43 // frames. 45 // frames.
44 SpdyProxyClientSocket(SpdyStream* spdy_stream, 46 SpdyProxyClientSocket(SpdyStream* spdy_stream,
45 const std::string& user_agent, 47 const std::string& user_agent,
46 const HostPortPair& endpoint, 48 const HostPortPair& endpoint,
47 const GURL& url, 49 const GURL& url,
48 const HostPortPair& proxy_server, 50 const HostPortPair& proxy_server,
49 HttpAuthCache* auth_cache, 51 HttpAuthCache* auth_cache,
50 HttpAuthHandlerFactory* auth_handler_factory); 52 HttpAuthHandlerFactory* auth_handler_factory);
51 53
52 54
53 // On destruction Disconnect() is called. 55 // On destruction Disconnect() is called.
54 virtual ~SpdyProxyClientSocket(); 56 virtual ~SpdyProxyClientSocket();
55 57
56 const scoped_refptr<HttpAuthController>& auth_controller() { 58 const scoped_refptr<HttpAuthController>& auth_controller() {
57 return auth_; 59 return auth_;
58 } 60 }
59 61
60 const HttpResponseInfo* GetConnectResponseInfo() const { 62 // HttpProxyTunnelClientSocket methods:
63
64 virtual const HttpResponseInfo* GetConnectResponseInfo() const {
61 return response_.headers ? &response_ : NULL; 65 return response_.headers ? &response_ : NULL;
62 } 66 }
63 67
68 // In the event of a non-200 response to the CONNECT request, this
69 // method may be called to return an HttpStream in order to read
70 // the response body.
71 virtual HttpStream* GetConnectResponseStream() {
72 SpdyStream* stream = spdy_stream_;
vandebo (ex-Chrome) 2010/12/04 00:30:37 Should this implementation go in the .cpp ?
Ryan Hamilton 2010/12/09 21:19:35 Done.
73 spdy_stream_ = NULL;
74 return new SpdyHttpStream(stream);
75 }
76
64 // ClientSocket methods: 77 // ClientSocket methods:
65 78
66 virtual int Connect(CompletionCallback* callback); 79 virtual int Connect(CompletionCallback* callback);
67 virtual void Disconnect(); 80 virtual void Disconnect();
68 virtual bool IsConnected() const; 81 virtual bool IsConnected() const;
69 virtual bool IsConnectedAndIdle() const; 82 virtual bool IsConnectedAndIdle() const;
70 virtual const BoundNetLog& NetLog() const { return net_log_; } 83 virtual const BoundNetLog& NetLog() const { return net_log_; }
71 virtual void SetSubresourceSpeculation(); 84 virtual void SetSubresourceSpeculation();
72 virtual void SetOmniboxSpeculation(); 85 virtual void SetOmniboxSpeculation();
73 virtual bool WasEverUsed() const; 86 virtual bool WasEverUsed() const;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 bool was_ever_used_; 189 bool was_ever_used_;
177 190
178 const BoundNetLog net_log_; 191 const BoundNetLog net_log_;
179 192
180 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket); 193 DISALLOW_COPY_AND_ASSIGN(SpdyProxyClientSocket);
181 }; 194 };
182 195
183 } // namespace net 196 } // namespace net
184 197
185 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_ 198 #endif // NET_SPDY_SPDY_PROXY_CLIENT_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698