| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 write_callback_weak_factory_(this) { | 50 write_callback_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_HTTP2_PROXY_CLIENT_SESSION, |
| 61 spdy_stream->net_log().source().ToEventParametersCallback()); | 61 spdy_stream->net_log().source().ToEventParametersCallback()); |
| 62 | 62 |
| 63 spdy_stream_->SetDelegate(this); | 63 spdy_stream_->SetDelegate(this); |
| 64 was_ever_used_ = spdy_stream_->WasEverUsed(); | 64 was_ever_used_ = spdy_stream_->WasEverUsed(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 SpdyProxyClientSocket::~SpdyProxyClientSocket() { | 67 SpdyProxyClientSocket::~SpdyProxyClientSocket() { |
| 68 Disconnect(); | 68 Disconnect(); |
| 69 net_log_.EndEvent(NetLog::TYPE_SOCKET_ALIVE); | 69 net_log_.EndEvent(NetLog::TYPE_SOCKET_ALIVE); |
| 70 } | 70 } |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } else if (!read_callback_.is_null()) { | 531 } else if (!read_callback_.is_null()) { |
| 532 // If we have a read_callback_, the we need to make sure we call it back. | 532 // If we have a read_callback_, the we need to make sure we call it back. |
| 533 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 533 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
| 534 } | 534 } |
| 535 // This may have been deleted by read_callback_, so check first. | 535 // This may have been deleted by read_callback_, so check first. |
| 536 if (weak_ptr.get() && !write_callback.is_null()) | 536 if (weak_ptr.get() && !write_callback.is_null()) |
| 537 write_callback.Run(ERR_CONNECTION_CLOSED); | 537 write_callback.Run(ERR_CONNECTION_CLOSED); |
| 538 } | 538 } |
| 539 | 539 |
| 540 } // namespace net | 540 } // namespace net |
| OLD | NEW |