OLD | NEW |
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 #include "net/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
6 | 6 |
7 #include <algorithm> // min | 7 #include <algorithm> // min |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 endpoint_(endpoint), | 38 endpoint_(endpoint), |
39 auth_( | 39 auth_( |
40 new HttpAuthController(HttpAuth::AUTH_PROXY, | 40 new HttpAuthController(HttpAuth::AUTH_PROXY, |
41 GURL("https://" + proxy_server.ToString()), | 41 GURL("https://" + proxy_server.ToString()), |
42 auth_cache, | 42 auth_cache, |
43 auth_handler_factory)), | 43 auth_handler_factory)), |
44 user_buffer_len_(0), | 44 user_buffer_len_(0), |
45 write_buffer_len_(0), | 45 write_buffer_len_(0), |
46 was_ever_used_(false), | 46 was_ever_used_(false), |
47 redirect_has_load_timing_info_(false), | 47 redirect_has_load_timing_info_(false), |
48 weak_factory_(this), | |
49 net_log_(BoundNetLog::Make(spdy_stream->net_log().net_log(), | 48 net_log_(BoundNetLog::Make(spdy_stream->net_log().net_log(), |
50 NetLog::SOURCE_PROXY_CLIENT_SOCKET)) { | 49 NetLog::SOURCE_PROXY_CLIENT_SOCKET)), |
| 50 weak_factory_(this) { |
51 request_.method = "CONNECT"; | 51 request_.method = "CONNECT"; |
52 request_.url = url; | 52 request_.url = url; |
53 if (!user_agent.empty()) | 53 if (!user_agent.empty()) |
54 request_.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, | 54 request_.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, |
55 user_agent); | 55 user_agent); |
56 | 56 |
57 net_log_.BeginEvent(NetLog::TYPE_SOCKET_ALIVE, | 57 net_log_.BeginEvent(NetLog::TYPE_SOCKET_ALIVE, |
58 source_net_log.source().ToEventParametersCallback()); | 58 source_net_log.source().ToEventParametersCallback()); |
59 net_log_.AddEvent( | 59 net_log_.AddEvent( |
60 NetLog::TYPE_SPDY_PROXY_CLIENT_SESSION, | 60 NetLog::TYPE_SPDY_PROXY_CLIENT_SESSION, |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } else if (!read_callback_.is_null()) { | 516 } else if (!read_callback_.is_null()) { |
517 // If we have a read_callback_, the we need to make sure we call it back. | 517 // If we have a read_callback_, the we need to make sure we call it back. |
518 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 518 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
519 } | 519 } |
520 // This may have been deleted by read_callback_, so check first. | 520 // This may have been deleted by read_callback_, so check first. |
521 if (weak_ptr.get() && !write_callback.is_null()) | 521 if (weak_ptr.get() && !write_callback.is_null()) |
522 write_callback.Run(ERR_CONNECTION_CLOSED); | 522 write_callback.Run(ERR_CONNECTION_CLOSED); |
523 } | 523 } |
524 | 524 |
525 } // namespace net | 525 } // namespace net |
OLD | NEW |