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 "chrome/browser/extensions/updater/extension_downloader.h" | 5 #include "chrome/browser/extensions/updater/extension_downloader.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 extensions_queue_.active_request_failure_count() < kMaxRetries) { | 714 extensions_queue_.active_request_failure_count() < kMaxRetries) { |
715 extensions_queue_.RetryRequest(backoff_delay); | 715 extensions_queue_.RetryRequest(backoff_delay); |
716 } else { | 716 } else { |
717 RETRY_HISTOGRAM("CrxFetchFailure", | 717 RETRY_HISTOGRAM("CrxFetchFailure", |
718 extensions_queue_.active_request_failure_count(), url); | 718 extensions_queue_.active_request_failure_count(), url); |
719 // status.error() is 0 (net::OK) or negative. (See net/base/net_errors.h) | 719 // status.error() is 0 (net::OK) or negative. (See net/base/net_errors.h) |
720 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.CrxFetchError", -status.error()); | 720 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.CrxFetchError", -status.error()); |
721 delegate_->OnExtensionDownloadFailed( | 721 delegate_->OnExtensionDownloadFailed( |
722 id, ExtensionDownloaderDelegate::CRX_FETCH_FAILED, ping, request_ids); | 722 id, ExtensionDownloaderDelegate::CRX_FETCH_FAILED, ping, request_ids); |
723 } | 723 } |
| 724 ping_results_.erase(id); |
724 extensions_queue_.reset_active_request(); | 725 extensions_queue_.reset_active_request(); |
725 ping_results_.erase(id); | |
726 } | 726 } |
727 | 727 |
728 extension_fetcher_.reset(); | 728 extension_fetcher_.reset(); |
729 | 729 |
730 // If there are any pending downloads left, start the next one. | 730 // If there are any pending downloads left, start the next one. |
731 extensions_queue_.StartNextRequest(); | 731 extensions_queue_.StartNextRequest(); |
732 } | 732 } |
733 | 733 |
734 void ExtensionDownloader::NotifyExtensionsDownloadFailed( | 734 void ExtensionDownloader::NotifyExtensionsDownloadFailed( |
735 const std::set<std::string>& extension_ids, | 735 const std::set<std::string>& extension_ids, |
(...skipping 10 matching lines...) Expand all Loading... |
746 void ExtensionDownloader::NotifyUpdateFound(const std::string& id, | 746 void ExtensionDownloader::NotifyUpdateFound(const std::string& id, |
747 const std::string& version) { | 747 const std::string& version) { |
748 UpdateDetails updateInfo(id, Version(version)); | 748 UpdateDetails updateInfo(id, Version(version)); |
749 content::NotificationService::current()->Notify( | 749 content::NotificationService::current()->Notify( |
750 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, | 750 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, |
751 content::NotificationService::AllBrowserContextsAndSources(), | 751 content::NotificationService::AllBrowserContextsAndSources(), |
752 content::Details<UpdateDetails>(&updateInfo)); | 752 content::Details<UpdateDetails>(&updateInfo)); |
753 } | 753 } |
754 | 754 |
755 } // namespace extensions | 755 } // namespace extensions |
OLD | NEW |