| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 std::string hash_in_hex = base::HexEncode(sha256_hash_value, | 568 std::string hash_in_hex = base::HexEncode(sha256_hash_value, |
| 569 base::SHA256_LENGTH); | 569 base::SHA256_LENGTH); |
| 570 | 570 |
| 571 if (current_extension_fetch_.package_hash != hash_in_hex) { | 571 if (current_extension_fetch_.package_hash != hash_in_hex) { |
| 572 NOTREACHED() << "Fetched blacklist checksum is not as expected. " | 572 NOTREACHED() << "Fetched blacklist checksum is not as expected. " |
| 573 << "Expected: " << current_extension_fetch_.package_hash | 573 << "Expected: " << current_extension_fetch_.package_hash |
| 574 << " Actual: " << hash_in_hex; | 574 << " Actual: " << hash_in_hex; |
| 575 return; | 575 return; |
| 576 } | 576 } |
| 577 std::vector<std::string> blacklist; | 577 std::vector<std::string> blacklist; |
| 578 SplitString(data, '\n', &blacklist); | 578 base::SplitString(data, '\n', &blacklist); |
| 579 | 579 |
| 580 // Tell ExtensionService to update prefs. | 580 // Tell ExtensionService to update prefs. |
| 581 service_->UpdateExtensionBlacklist(blacklist); | 581 service_->UpdateExtensionBlacklist(blacklist); |
| 582 | 582 |
| 583 // Update the pref value for blacklist version | 583 // Update the pref value for blacklist version |
| 584 prefs_->SetString(kExtensionBlacklistUpdateVersion, | 584 prefs_->SetString(kExtensionBlacklistUpdateVersion, |
| 585 current_extension_fetch_.version); | 585 current_extension_fetch_.version); |
| 586 prefs_->ScheduleSavePersistentPrefs(); | 586 prefs_->ScheduleSavePersistentPrefs(); |
| 587 } | 587 } |
| 588 | 588 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 extension_fetcher_.reset( | 848 extension_fetcher_.reset( |
| 849 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); | 849 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); |
| 850 extension_fetcher_->set_request_context( | 850 extension_fetcher_->set_request_context( |
| 851 Profile::GetDefaultRequestContext()); | 851 Profile::GetDefaultRequestContext()); |
| 852 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | | 852 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | |
| 853 net::LOAD_DO_NOT_SAVE_COOKIES); | 853 net::LOAD_DO_NOT_SAVE_COOKIES); |
| 854 extension_fetcher_->Start(); | 854 extension_fetcher_->Start(); |
| 855 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); | 855 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); |
| 856 } | 856 } |
| 857 } | 857 } |
| OLD | NEW |