| 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 "extensions/browser/updater/extension_downloader.h" | 5 #include "extensions/browser/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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } else { | 724 } else { |
| 725 extensions_queue_.ScheduleRequest(fetch_data.Pass()); | 725 extensions_queue_.ScheduleRequest(fetch_data.Pass()); |
| 726 } | 726 } |
| 727 } | 727 } |
| 728 } | 728 } |
| 729 | 729 |
| 730 void ExtensionDownloader::NotifyDelegateDownloadFinished( | 730 void ExtensionDownloader::NotifyDelegateDownloadFinished( |
| 731 scoped_ptr<ExtensionFetch> fetch_data, | 731 scoped_ptr<ExtensionFetch> fetch_data, |
| 732 const base::FilePath& crx_path, | 732 const base::FilePath& crx_path, |
| 733 bool file_ownership_passed) { | 733 bool file_ownership_passed) { |
| 734 delegate_->OnExtensionDownloadFinished(fetch_data->id, | 734 delegate_->OnExtensionDownloadFinished( |
| 735 crx_path, | 735 CRXFileInfo(fetch_data->id, crx_path, fetch_data->package_hash), |
| 736 file_ownership_passed, | 736 file_ownership_passed, fetch_data->url, fetch_data->version, |
| 737 fetch_data->url, | 737 ping_results_[fetch_data->id], fetch_data->request_ids); |
| 738 fetch_data->version, | |
| 739 ping_results_[fetch_data->id], | |
| 740 fetch_data->request_ids); | |
| 741 ping_results_.erase(fetch_data->id); | 738 ping_results_.erase(fetch_data->id); |
| 742 } | 739 } |
| 743 | 740 |
| 744 void ExtensionDownloader::CreateExtensionFetcher() { | 741 void ExtensionDownloader::CreateExtensionFetcher() { |
| 745 const ExtensionFetch* fetch = extensions_queue_.active_request(); | 742 const ExtensionFetch* fetch = extensions_queue_.active_request(); |
| 746 extension_fetcher_.reset(net::URLFetcher::Create( | 743 extension_fetcher_.reset(net::URLFetcher::Create( |
| 747 kExtensionFetcherId, fetch->url, net::URLFetcher::GET, this)); | 744 kExtensionFetcherId, fetch->url, net::URLFetcher::GET, this)); |
| 748 extension_fetcher_->SetRequestContext(request_context_.get()); | 745 extension_fetcher_->SetRequestContext(request_context_.get()); |
| 749 extension_fetcher_->SetAutomaticallyRetryOnNetworkChanges(3); | 746 extension_fetcher_->SetAutomaticallyRetryOnNetworkChanges(3); |
| 750 | 747 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 const GURL& update_url, | 949 const GURL& update_url, |
| 953 int request_id) { | 950 int request_id) { |
| 954 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; | 951 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; |
| 955 if (update_url.DomainIs(ping_enabled_domain_.c_str())) | 952 if (update_url.DomainIs(ping_enabled_domain_.c_str())) |
| 956 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; | 953 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; |
| 957 return new ManifestFetchData( | 954 return new ManifestFetchData( |
| 958 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); | 955 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); |
| 959 } | 956 } |
| 960 | 957 |
| 961 } // namespace extensions | 958 } // namespace extensions |
| OLD | NEW |