Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: extensions/browser/updater/extension_downloader.cc

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest build for windows. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/sandboxed_unpacker_unittest.cc ('k') | extensions/browser/updater/extension_downloader_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698