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_fetcher_core.h" | 5 #include "net/url_request/url_fetcher_core.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 if (is_chunked_upload_) | 514 if (is_chunked_upload_) |
| 515 request_->EnableChunkedUpload(); | 515 request_->EnableChunkedUpload(); |
| 516 request_->SetLoadFlags(flags); | 516 request_->SetLoadFlags(flags); |
| 517 request_->SetReferrer(referrer_); | 517 request_->SetReferrer(referrer_); |
| 518 request_->set_first_party_for_cookies(first_party_for_cookies_.is_empty() ? | 518 request_->set_first_party_for_cookies(first_party_for_cookies_.is_empty() ? |
| 519 original_url_ : first_party_for_cookies_); | 519 original_url_ : first_party_for_cookies_); |
| 520 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { | 520 if (url_request_data_key_ && !url_request_create_data_callback_.is_null()) { |
| 521 request_->SetUserData(url_request_data_key_, | 521 request_->SetUserData(url_request_data_key_, |
| 522 url_request_create_data_callback_.Run()); | 522 url_request_create_data_callback_.Run()); |
| 523 } | 523 } |
| 524 // Don't duplicate retrying in both URLFetcher and URLRequest as this can have | |
| 525 // a multiplicative effect. | |
| 526 if (max_retries_on_network_changes_) | |
|
mmenke
2014/02/13 20:20:17
I think it's weird to have two ways to do this. A
| |
| 527 request_->set_max_automatic_retries_on_network_changes(0); | |
| 524 | 528 |
| 525 switch (request_type_) { | 529 switch (request_type_) { |
| 526 case URLFetcher::GET: | 530 case URLFetcher::GET: |
| 527 break; | 531 break; |
| 528 | 532 |
| 529 case URLFetcher::POST: | 533 case URLFetcher::POST: |
| 530 case URLFetcher::PUT: | 534 case URLFetcher::PUT: |
| 531 case URLFetcher::PATCH: | 535 case URLFetcher::PATCH: |
| 532 // Upload content must be set. | 536 // Upload content must be set. |
| 533 DCHECK(is_chunked_upload_ || upload_content_set_); | 537 DCHECK(is_chunked_upload_ || upload_content_set_); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 887 } | 891 } |
| 888 | 892 |
| 889 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( | 893 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( |
| 890 int64 current, int64 total) { | 894 int64 current, int64 total) { |
| 891 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 895 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
| 892 if (delegate_) | 896 if (delegate_) |
| 893 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); | 897 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); |
| 894 } | 898 } |
| 895 | 899 |
| 896 } // namespace net | 900 } // namespace net |
| OLD | NEW |