| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 request_->context()->cookie_store()->GetCookiesWithInfoAsync( | 536 request_->context()->cookie_store()->GetCookiesWithInfoAsync( |
| 537 request_->url(), options, | 537 request_->url(), options, |
| 538 base::Bind(&URLRequestHttpJob::OnCookiesLoaded, | 538 base::Bind(&URLRequestHttpJob::OnCookiesLoaded, |
| 539 weak_ptr_factory_.GetWeakPtr())); | 539 weak_ptr_factory_.GetWeakPtr())); |
| 540 } else { | 540 } else { |
| 541 DoStartTransaction(); | 541 DoStartTransaction(); |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 | 544 |
| 545 void URLRequestHttpJob::OnCookiesLoaded( | 545 void URLRequestHttpJob::OnCookiesLoaded( |
| 546 std::string* cookie_line, | 546 const std::string& cookie_line, |
| 547 std::vector<net::CookieStore::CookieInfo>* cookie_infos) { | 547 const std::vector<net::CookieStore::CookieInfo>& cookie_infos) { |
| 548 if (!cookie_line->empty()) { | 548 if (!cookie_line.empty()) { |
| 549 request_info_.extra_headers.SetHeader( | 549 request_info_.extra_headers.SetHeader( |
| 550 HttpRequestHeaders::kCookie, *cookie_line); | 550 HttpRequestHeaders::kCookie, cookie_line); |
| 551 } | 551 } |
| 552 if (URLRequest::AreMacCookiesEnabled()) | 552 if (URLRequest::AreMacCookiesEnabled()) |
| 553 AddAuthorizationHeader(*cookie_infos, &request_info_); | 553 AddAuthorizationHeader(cookie_infos, &request_info_); |
| 554 DoStartTransaction(); | 554 DoStartTransaction(); |
| 555 } | 555 } |
| 556 | 556 |
| 557 void URLRequestHttpJob::DoStartTransaction() { | 557 void URLRequestHttpJob::DoStartTransaction() { |
| 558 // We may have been canceled while retrieving cookies. | 558 // We may have been canceled while retrieving cookies. |
| 559 if (GetStatus().is_success()) { | 559 if (GetStatus().is_success()) { |
| 560 StartTransaction(); | 560 StartTransaction(); |
| 561 } else { | 561 } else { |
| 562 NotifyCanceled(); | 562 NotifyCanceled(); |
| 563 } | 563 } |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 if (done_) | 1475 if (done_) |
| 1476 return; | 1476 return; |
| 1477 done_ = true; | 1477 done_ = true; |
| 1478 | 1478 |
| 1479 RecordPerfHistograms(reason); | 1479 RecordPerfHistograms(reason); |
| 1480 if (reason == FINISHED) | 1480 if (reason == FINISHED) |
| 1481 RecordCompressionHistograms(); | 1481 RecordCompressionHistograms(); |
| 1482 } | 1482 } |
| 1483 | 1483 |
| 1484 } // namespace net | 1484 } // namespace net |
| OLD | NEW |