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(URLRequest* request, | |
626 SSLCertRequestInfo* cert_request_info) { | |
Ryan Sleevi
2013/01/09 21:45:54
style nit: wrapping should have URLRequest* on a n
zel
2013/01/09 23:10:37
Done.
| |
627 request->ContinueWithCertificate(NULL); | |
628 } | |
629 | |
625 void URLFetcherCore::OnConnectionTypeChanged( | 630 void URLFetcherCore::OnConnectionTypeChanged( |
626 NetworkChangeNotifier::ConnectionType type) { | 631 NetworkChangeNotifier::ConnectionType type) { |
627 DCHECK_GT(num_retries_on_network_changes_, 0); | 632 DCHECK_GT(num_retries_on_network_changes_, 0); |
628 if (type == NetworkChangeNotifier::CONNECTION_NONE) { | 633 if (type == NetworkChangeNotifier::CONNECTION_NONE) { |
629 // Keep waiting. | 634 // Keep waiting. |
630 return; | 635 return; |
631 } | 636 } |
632 | 637 |
633 // Stop observing and try again now. | 638 // Stop observing and try again now. |
634 NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 639 NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1058 } | 1063 } |
1059 | 1064 |
1060 void URLFetcherCore::InformDelegateDownloadDataInDelegateThread( | 1065 void URLFetcherCore::InformDelegateDownloadDataInDelegateThread( |
1061 scoped_ptr<std::string> download_data) { | 1066 scoped_ptr<std::string> download_data) { |
1062 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 1067 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
1063 if (delegate_) | 1068 if (delegate_) |
1064 delegate_->OnURLFetchDownloadData(fetcher_, download_data.Pass()); | 1069 delegate_->OnURLFetchDownloadData(fetcher_, download_data.Pass()); |
1065 } | 1070 } |
1066 | 1071 |
1067 } // namespace net | 1072 } // namespace net |
OLD | NEW |