Chromium Code Reviews| 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_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/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 456 // Since we're tagging this transaction as advertising a dictionary, | 456 // Since we're tagging this transaction as advertising a dictionary, |
| 457 // we'll definitely employ an SDCH filter (or tentative sdch filter) | 457 // we'll definitely employ an SDCH filter (or tentative sdch filter) |
| 458 // when we get a response. When done, we'll record histograms via | 458 // when we get a response. When done, we'll record histograms via |
| 459 // SDCH_DECODE or SDCH_PASSTHROUGH. Hence we need to record packet | 459 // SDCH_DECODE or SDCH_PASSTHROUGH. Hence we need to record packet |
| 460 // arrival times. | 460 // arrival times. |
| 461 packet_timing_enabled_ = true; | 461 packet_timing_enabled_ = true; |
| 462 } | 462 } |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 | 465 |
| 466 const URLRequestContext* context = request_->context(); | 466 const URLRequestContext* context = request_->context(); |
|
willchan no longer on Chromium
2012/10/06 19:32:49
Long-term, we should pass in the HttpUserAgentSett
erikwright (departed)
2012/10/09 15:24:46
Correct. I think it would make a good statement ab
| |
| 467 // Only add default Accept-Language and Accept-Charset if the request | 467 // Only add default Accept-Language and Accept-Charset if the request |
| 468 // didn't have them specified. | 468 // didn't have them specified. |
| 469 if (!context->accept_language().empty()) { | 469 if (!context->GetAcceptLanguage().empty()) { |
|
mmenke
2012/10/05 20:08:51
Suggest you cache both of these to a local to avoi
| |
| 470 request_info_.extra_headers.SetHeaderIfMissing( | 470 request_info_.extra_headers.SetHeaderIfMissing( |
| 471 HttpRequestHeaders::kAcceptLanguage, | 471 HttpRequestHeaders::kAcceptLanguage, |
| 472 context->accept_language()); | 472 context->GetAcceptLanguage()); |
| 473 } | 473 } |
| 474 if (!context->accept_charset().empty()) { | 474 if (!context->GetAcceptCharset().empty()) { |
| 475 request_info_.extra_headers.SetHeaderIfMissing( | 475 request_info_.extra_headers.SetHeaderIfMissing( |
| 476 HttpRequestHeaders::kAcceptCharset, | 476 HttpRequestHeaders::kAcceptCharset, |
| 477 context->accept_charset()); | 477 context->GetAcceptCharset()); |
| 478 } | 478 } |
| 479 } | 479 } |
| 480 | 480 |
| 481 void URLRequestHttpJob::AddCookieHeaderAndStart() { | 481 void URLRequestHttpJob::AddCookieHeaderAndStart() { |
| 482 // No matter what, we want to report our status as IO pending since we will | 482 // No matter what, we want to report our status as IO pending since we will |
| 483 // be notifying our consumer asynchronously via OnStartCompleted. | 483 // be notifying our consumer asynchronously via OnStartCompleted. |
| 484 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); | 484 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); |
| 485 | 485 |
| 486 // If the request was destroyed, then there is no more work to do. | 486 // If the request was destroyed, then there is no more work to do. |
| 487 if (!request_) | 487 if (!request_) |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1501 | 1501 |
| 1502 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1502 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1503 awaiting_callback_ = false; | 1503 awaiting_callback_ = false; |
| 1504 } | 1504 } |
| 1505 | 1505 |
| 1506 void URLRequestHttpJob::OnDetachRequest() { | 1506 void URLRequestHttpJob::OnDetachRequest() { |
| 1507 http_transaction_delegate_->OnDetachRequest(); | 1507 http_transaction_delegate_->OnDetachRequest(); |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 } // namespace net | 1510 } // namespace net |
| OLD | NEW |