| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cronet_url_request_adapter.h" | 5 #include "cronet_url_request_adapter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "components/cronet/android/cronet_url_request_context_adapter.h" | 10 #include "components/cronet/android/cronet_url_request_context_adapter.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 CronetURLRequestAdapter::GetResponseHeaders() const { | 110 CronetURLRequestAdapter::GetResponseHeaders() const { |
| 111 DCHECK(IsOnNetworkThread()); | 111 DCHECK(IsOnNetworkThread()); |
| 112 return url_request_->response_headers(); | 112 return url_request_->response_headers(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 const std::string& CronetURLRequestAdapter::GetNegotiatedProtocol() const { | 115 const std::string& CronetURLRequestAdapter::GetNegotiatedProtocol() const { |
| 116 DCHECK(IsOnNetworkThread()); | 116 DCHECK(IsOnNetworkThread()); |
| 117 return url_request_->response_info().npn_negotiated_protocol; | 117 return url_request_->response_info().npn_negotiated_protocol; |
| 118 } | 118 } |
| 119 | 119 |
| 120 const std::string CronetURLRequestAdapter::GetProxyServer() const { |
| 121 DCHECK(IsOnNetworkThread()); |
| 122 return url_request_->response_info().proxy_server.ToString(); |
| 123 } |
| 124 |
| 120 bool CronetURLRequestAdapter::GetWasCached() const { | 125 bool CronetURLRequestAdapter::GetWasCached() const { |
| 121 DCHECK(IsOnNetworkThread()); | 126 DCHECK(IsOnNetworkThread()); |
| 122 return url_request_->response_info().was_cached; | 127 return url_request_->response_info().was_cached; |
| 123 } | 128 } |
| 124 | 129 |
| 125 int64 CronetURLRequestAdapter::GetTotalReceivedBytes() const { | 130 int64 CronetURLRequestAdapter::GetTotalReceivedBytes() const { |
| 126 DCHECK(IsOnNetworkThread()); | 131 DCHECK(IsOnNetworkThread()); |
| 127 return url_request_->GetTotalReceivedBytes(); | 132 return url_request_->GetTotalReceivedBytes(); |
| 128 } | 133 } |
| 129 | 134 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 DCHECK_EQ(request, url_request_); | 169 DCHECK_EQ(request, url_request_); |
| 165 if (url_request_->status().is_success()) | 170 if (url_request_->status().is_success()) |
| 166 return false; | 171 return false; |
| 167 VLOG(1) << "Error " << url_request_->status().error() | 172 VLOG(1) << "Error " << url_request_->status().error() |
| 168 << " on chromium request: " << initial_url_.possibly_invalid_spec(); | 173 << " on chromium request: " << initial_url_.possibly_invalid_spec(); |
| 169 delegate_->OnError(url_request_->status().error()); | 174 delegate_->OnError(url_request_->status().error()); |
| 170 return true; | 175 return true; |
| 171 } | 176 } |
| 172 | 177 |
| 173 } // namespace cronet | 178 } // namespace cronet |
| OLD | NEW |