OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_updater.h" | 5 #include "chrome/browser/extensions/extension_updater.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 extension_prefs_->SetLastActivePingDay(*i, daystart); | 788 extension_prefs_->SetLastActivePingDay(*i, daystart); |
789 } | 789 } |
790 } | 790 } |
791 } | 791 } |
792 NotifyIfFinished(); | 792 NotifyIfFinished(); |
793 } | 793 } |
794 | 794 |
795 void ExtensionUpdater::ProcessBlacklist(const std::string& data) { | 795 void ExtensionUpdater::ProcessBlacklist(const std::string& data) { |
796 DCHECK(alive_); | 796 DCHECK(alive_); |
797 // Verify sha256 hash value. | 797 // Verify sha256 hash value. |
798 char sha256_hash_value[crypto::SHA256_LENGTH]; | 798 char sha256_hash_value[crypto::kSHA256Length]; |
799 crypto::SHA256HashString(data, sha256_hash_value, crypto::SHA256_LENGTH); | 799 crypto::SHA256HashString(data, sha256_hash_value, crypto::kSHA256Length); |
800 std::string hash_in_hex = base::HexEncode(sha256_hash_value, | 800 std::string hash_in_hex = base::HexEncode(sha256_hash_value, |
801 crypto::SHA256_LENGTH); | 801 crypto::kSHA256Length); |
802 | 802 |
803 if (current_extension_fetch_.package_hash != hash_in_hex) { | 803 if (current_extension_fetch_.package_hash != hash_in_hex) { |
804 NOTREACHED() << "Fetched blacklist checksum is not as expected. " | 804 NOTREACHED() << "Fetched blacklist checksum is not as expected. " |
805 << "Expected: " << current_extension_fetch_.package_hash | 805 << "Expected: " << current_extension_fetch_.package_hash |
806 << " Actual: " << hash_in_hex; | 806 << " Actual: " << hash_in_hex; |
807 return; | 807 return; |
808 } | 808 } |
809 std::vector<std::string> blacklist; | 809 std::vector<std::string> blacklist; |
810 base::SplitString(data, '\n', &blacklist); | 810 base::SplitString(data, '\n', &blacklist); |
811 | 811 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 std::set<std::string>::const_iterator i; | 1242 std::set<std::string>::const_iterator i; |
1243 for (i = ids.begin(); i != ids.end(); ++i) | 1243 for (i = ids.begin(); i != ids.end(); ++i) |
1244 in_progress_ids_.insert(*i); | 1244 in_progress_ids_.insert(*i); |
1245 } | 1245 } |
1246 | 1246 |
1247 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { | 1247 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { |
1248 std::set<std::string>::const_iterator i; | 1248 std::set<std::string>::const_iterator i; |
1249 for (i = ids.begin(); i != ids.end(); ++i) | 1249 for (i = ids.begin(); i != ids.end(); ++i) |
1250 in_progress_ids_.erase(*i); | 1250 in_progress_ids_.erase(*i); |
1251 } | 1251 } |
OLD | NEW |