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/url_request/url_request.h" | 5 #include "net/url_request/url_request.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 return job_->GetFullRequestHeaders(headers); | 259 return job_->GetFullRequestHeaders(headers); |
260 } | 260 } |
261 | 261 |
262 int64 URLRequest::GetTotalReceivedBytes() const { | 262 int64 URLRequest::GetTotalReceivedBytes() const { |
263 if (!job_.get()) | 263 if (!job_.get()) |
264 return 0; | 264 return 0; |
265 | 265 |
266 return job_->GetTotalReceivedBytes(); | 266 return job_->GetTotalReceivedBytes(); |
267 } | 267 } |
268 | 268 |
| 269 int64_t URLRequest::GetTotalSentBytes() const { |
| 270 if (!job_.get()) |
| 271 return 0; |
| 272 |
| 273 return job_->GetTotalSentBytes(); |
| 274 } |
| 275 |
269 LoadStateWithParam URLRequest::GetLoadState() const { | 276 LoadStateWithParam URLRequest::GetLoadState() const { |
270 // The !blocked_by_.empty() check allows |this| to report it's blocked on a | 277 // The !blocked_by_.empty() check allows |this| to report it's blocked on a |
271 // delegate before it has been started. | 278 // delegate before it has been started. |
272 if (calling_delegate_ || !blocked_by_.empty()) { | 279 if (calling_delegate_ || !blocked_by_.empty()) { |
273 return LoadStateWithParam( | 280 return LoadStateWithParam( |
274 LOAD_STATE_WAITING_FOR_DELEGATE, | 281 LOAD_STATE_WAITING_FOR_DELEGATE, |
275 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) : | 282 use_blocked_by_as_load_param_ ? base::UTF8ToUTF16(blocked_by_) : |
276 base::string16()); | 283 base::string16()); |
277 } | 284 } |
278 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, | 285 return LoadStateWithParam(job_.get() ? job_->GetLoadState() : LOAD_STATE_IDLE, |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 } | 1193 } |
1187 | 1194 |
1188 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { | 1195 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { |
1189 if (job_) | 1196 if (job_) |
1190 job_->GetConnectionAttempts(out); | 1197 job_->GetConnectionAttempts(out); |
1191 else | 1198 else |
1192 out->clear(); | 1199 out->clear(); |
1193 } | 1200 } |
1194 | 1201 |
1195 } // namespace net | 1202 } // namespace net |
OLD | NEW |