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

Side by Side Diff: chrome/browser/chromeos/extensions/external_cache.cc

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add histogram description. Created 5 years, 11 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/extensions/external_cache.h" 5 #include "chrome/browser/chromeos/extensions/external_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } else { 174 } else {
175 LOG(ERROR) << "ExternalCache failed to download extension " << id 175 LOG(ERROR) << "ExternalCache failed to download extension " << id
176 << ", error " << error; 176 << ", error " << error;
177 delegate_->OnExtensionDownloadFailed(id, error); 177 delegate_->OnExtensionDownloadFailed(id, error);
178 } 178 }
179 } 179 }
180 180
181 void ExternalCache::OnExtensionDownloadFinished( 181 void ExternalCache::OnExtensionDownloadFinished(
182 const std::string& id, 182 const std::string& id,
183 const base::FilePath& path, 183 const base::FilePath& path,
184 const std::string& hash,
184 bool file_ownership_passed, 185 bool file_ownership_passed,
185 const GURL& download_url, 186 const GURL& download_url,
186 const std::string& version, 187 const std::string& version,
187 const extensions::ExtensionDownloaderDelegate::PingResult& ping_result, 188 const extensions::ExtensionDownloaderDelegate::PingResult& ping_result,
188 const std::set<int>& request_ids) { 189 const std::set<int>& request_ids) {
189 DCHECK(file_ownership_passed); 190 DCHECK(file_ownership_passed);
190 local_cache_.PutExtension(id, path, version, 191 local_cache_.PutExtension(id, path, version,
191 base::Bind(&ExternalCache::OnPutExtension, 192 base::Bind(&ExternalCache::OnPutExtension,
192 weak_ptr_factory_.GetWeakPtr(), 193 weak_ptr_factory_.GetWeakPtr(),
193 id)); 194 id));
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 OnPutExtension(id, file_path, file_ownership_passed); 346 OnPutExtension(id, file_path, file_ownership_passed);
346 callback.Run(id, !file_ownership_passed); 347 callback.Run(id, !file_ownership_passed);
347 } 348 }
348 349
349 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( 350 std::string ExternalCache::Delegate::GetInstalledExtensionVersion(
350 const std::string& id) { 351 const std::string& id) {
351 return std::string(); 352 return std::string();
352 } 353 }
353 354
354 } // namespace chromeos 355 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698