| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 574 |
| 575 transaction_.reset( | 575 transaction_.reset( |
| 576 request_->context()->http_transaction_factory()->CreateTransaction()); | 576 request_->context()->http_transaction_factory()->CreateTransaction()); |
| 577 | 577 |
| 578 // No matter what, we want to report our status as IO pending since we will | 578 // No matter what, we want to report our status as IO pending since we will |
| 579 // be notifying our consumer asynchronously via OnStartCompleted. | 579 // be notifying our consumer asynchronously via OnStartCompleted. |
| 580 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); | 580 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); |
| 581 | 581 |
| 582 int rv; | 582 int rv; |
| 583 if (transaction_.get()) { | 583 if (transaction_.get()) { |
| 584 rv = transaction_->Start(&request_info_, &start_callback_); | 584 rv = transaction_->Start( |
| 585 request_->load_log(), &request_info_, &start_callback_); |
| 585 if (rv == net::ERR_IO_PENDING) | 586 if (rv == net::ERR_IO_PENDING) |
| 586 return; | 587 return; |
| 587 } else { | 588 } else { |
| 588 rv = net::ERR_FAILED; | 589 rv = net::ERR_FAILED; |
| 589 } | 590 } |
| 590 | 591 |
| 591 // The transaction started synchronously, but we need to notify the | 592 // The transaction started synchronously, but we need to notify the |
| 592 // URLRequest delegate via the message loop. | 593 // URLRequest delegate via the message loop. |
| 593 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 594 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
| 594 this, &URLRequestHttpJob::OnStartCompleted, rv)); | 595 this, &URLRequestHttpJob::OnStartCompleted, rv)); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 if (!ctx || !ctx->force_tls_state()) | 711 if (!ctx || !ctx->force_tls_state()) |
| 711 return; | 712 return; |
| 712 | 713 |
| 713 std::string name = "X-Force-TLS"; | 714 std::string name = "X-Force-TLS"; |
| 714 std::string value; | 715 std::string value; |
| 715 | 716 |
| 716 void* iter = NULL; | 717 void* iter = NULL; |
| 717 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) | 718 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) |
| 718 ctx->force_tls_state()->DidReceiveHeader(request_info_.url, value); | 719 ctx->force_tls_state()->DidReceiveHeader(request_info_.url, value); |
| 719 } | 720 } |
| OLD | NEW |