| 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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 read_buf_ = buf; | 372 read_buf_ = buf; |
| 373 read_buf_len_ = buf_len; | 373 read_buf_len_ = buf_len; |
| 374 | 374 |
| 375 next_state_ = next_state; | 375 next_state_ = next_state; |
| 376 int rv = DoLoop(OK); | 376 int rv = DoLoop(OK); |
| 377 if (rv == ERR_IO_PENDING) | 377 if (rv == ERR_IO_PENDING) |
| 378 callback_ = callback; | 378 callback_ = callback; |
| 379 return rv; | 379 return rv; |
| 380 } | 380 } |
| 381 | 381 |
| 382 void HttpNetworkTransaction::StopCaching() {} |
| 383 |
| 382 bool HttpNetworkTransaction::GetFullRequestHeaders( | 384 bool HttpNetworkTransaction::GetFullRequestHeaders( |
| 383 HttpRequestHeaders* headers) const { | 385 HttpRequestHeaders* headers) const { |
| 384 // TODO(ttuttle): Make sure we've populated request_headers_. | 386 // TODO(ttuttle): Make sure we've populated request_headers_. |
| 385 *headers = request_headers_; | 387 *headers = request_headers_; |
| 386 return true; | 388 return true; |
| 387 } | 389 } |
| 388 | 390 |
| 389 int64 HttpNetworkTransaction::GetTotalReceivedBytes() const { | 391 int64 HttpNetworkTransaction::GetTotalReceivedBytes() const { |
| 390 int64 total_received_bytes = total_received_bytes_; | 392 int64 total_received_bytes = total_received_bytes_; |
| 391 if (stream_) | 393 if (stream_) |
| 392 total_received_bytes += stream_->GetTotalReceivedBytes(); | 394 total_received_bytes += stream_->GetTotalReceivedBytes(); |
| 393 return total_received_bytes; | 395 return total_received_bytes; |
| 394 } | 396 } |
| 395 | 397 |
| 398 void HttpNetworkTransaction::DoneReading() {} |
| 399 |
| 396 const HttpResponseInfo* HttpNetworkTransaction::GetResponseInfo() const { | 400 const HttpResponseInfo* HttpNetworkTransaction::GetResponseInfo() const { |
| 397 return ((headers_valid_ && response_.headers.get()) || | 401 return ((headers_valid_ && response_.headers.get()) || |
| 398 response_.ssl_info.cert.get() || response_.cert_request_info.get()) | 402 response_.ssl_info.cert.get() || response_.cert_request_info.get()) |
| 399 ? &response_ | 403 ? &response_ |
| 400 : NULL; | 404 : NULL; |
| 401 } | 405 } |
| 402 | 406 |
| 403 LoadState HttpNetworkTransaction::GetLoadState() const { | 407 LoadState HttpNetworkTransaction::GetLoadState() const { |
| 404 // TODO(wtc): Define a new LoadState value for the | 408 // TODO(wtc): Define a new LoadState value for the |
| 405 // STATE_INIT_CONNECTION_COMPLETE state, which delays the HTTP request. | 409 // STATE_INIT_CONNECTION_COMPLETE state, which delays the HTTP request. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 422 } | 426 } |
| 423 | 427 |
| 424 UploadProgress HttpNetworkTransaction::GetUploadProgress() const { | 428 UploadProgress HttpNetworkTransaction::GetUploadProgress() const { |
| 425 if (!stream_.get()) | 429 if (!stream_.get()) |
| 426 return UploadProgress(); | 430 return UploadProgress(); |
| 427 | 431 |
| 428 // TODO(bashi): This cast is temporary. Remove later. | 432 // TODO(bashi): This cast is temporary. Remove later. |
| 429 return static_cast<HttpStream*>(stream_.get())->GetUploadProgress(); | 433 return static_cast<HttpStream*>(stream_.get())->GetUploadProgress(); |
| 430 } | 434 } |
| 431 | 435 |
| 436 void HttpNetworkTransaction::SetQuicServerInfo( |
| 437 QuicServerInfo* quic_server_info) {} |
| 438 |
| 432 bool HttpNetworkTransaction::GetLoadTimingInfo( | 439 bool HttpNetworkTransaction::GetLoadTimingInfo( |
| 433 LoadTimingInfo* load_timing_info) const { | 440 LoadTimingInfo* load_timing_info) const { |
| 434 if (!stream_ || !stream_->GetLoadTimingInfo(load_timing_info)) | 441 if (!stream_ || !stream_->GetLoadTimingInfo(load_timing_info)) |
| 435 return false; | 442 return false; |
| 436 | 443 |
| 437 load_timing_info->proxy_resolve_start = | 444 load_timing_info->proxy_resolve_start = |
| 438 proxy_info_.proxy_resolve_start_time(); | 445 proxy_info_.proxy_resolve_start_time(); |
| 439 load_timing_info->proxy_resolve_end = proxy_info_.proxy_resolve_end_time(); | 446 load_timing_info->proxy_resolve_end = proxy_info_.proxy_resolve_end_time(); |
| 440 load_timing_info->send_start = send_start_time_; | 447 load_timing_info->send_start = send_start_time_; |
| 441 load_timing_info->send_end = send_end_time_; | 448 load_timing_info->send_end = send_end_time_; |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1620 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1614 state); | 1621 state); |
| 1615 break; | 1622 break; |
| 1616 } | 1623 } |
| 1617 return description; | 1624 return description; |
| 1618 } | 1625 } |
| 1619 | 1626 |
| 1620 #undef STATE_CASE | 1627 #undef STATE_CASE |
| 1621 | 1628 |
| 1622 } // namespace net | 1629 } // namespace net |
| OLD | NEW |