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/file_util_proxy.h" | 8 #include "base/file_util_proxy.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // If the file is open, close it. After closing the file, | 615 // If the file is open, close it. After closing the file, |
616 // RetryOrCompleteUrlFetch() will be called. | 616 // RetryOrCompleteUrlFetch() will be called. |
617 file_writer_->CloseFileAndCompleteRequest(); | 617 file_writer_->CloseFileAndCompleteRequest(); |
618 } else { | 618 } else { |
619 // Otherwise, complete or retry the URL request directly. | 619 // Otherwise, complete or retry the URL request directly. |
620 RetryOrCompleteUrlFetch(); | 620 RetryOrCompleteUrlFetch(); |
621 } | 621 } |
622 } | 622 } |
623 } | 623 } |
624 | 624 |
| 625 void URLFetcherCore::OnCertificateRequested( |
| 626 URLRequest* request, |
| 627 SSLCertRequestInfo* cert_request_info) { |
| 628 request->ContinueWithCertificate(NULL); |
| 629 } |
| 630 |
625 void URLFetcherCore::OnConnectionTypeChanged( | 631 void URLFetcherCore::OnConnectionTypeChanged( |
626 NetworkChangeNotifier::ConnectionType type) { | 632 NetworkChangeNotifier::ConnectionType type) { |
627 DCHECK_GT(num_retries_on_network_changes_, 0); | 633 DCHECK_GT(num_retries_on_network_changes_, 0); |
628 if (type == NetworkChangeNotifier::CONNECTION_NONE) { | 634 if (type == NetworkChangeNotifier::CONNECTION_NONE) { |
629 // Keep waiting. | 635 // Keep waiting. |
630 return; | 636 return; |
631 } | 637 } |
632 | 638 |
633 // Stop observing and try again now. | 639 // Stop observing and try again now. |
634 NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 640 NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 } | 1064 } |
1059 | 1065 |
1060 void URLFetcherCore::InformDelegateDownloadDataInDelegateThread( | 1066 void URLFetcherCore::InformDelegateDownloadDataInDelegateThread( |
1061 scoped_ptr<std::string> download_data) { | 1067 scoped_ptr<std::string> download_data) { |
1062 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 1068 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
1063 if (delegate_) | 1069 if (delegate_) |
1064 delegate_->OnURLFetchDownloadData(fetcher_, download_data.Pass()); | 1070 delegate_->OnURLFetchDownloadData(fetcher_, download_data.Pass()); |
1065 } | 1071 } |
1066 | 1072 |
1067 } // namespace net | 1073 } // namespace net |
OLD | NEW |