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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_database.cc

Issue 9138003: Stop updating SafeBrowsing download hash list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: break removal code to separate cl (should be same as patchset 2) Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_database_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/safe_browsing/safe_browsing_database.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 std::vector<std::string> browse_listnames; 1062 std::vector<std::string> browse_listnames;
1063 browse_listnames.push_back(safe_browsing_util::kMalwareList); 1063 browse_listnames.push_back(safe_browsing_util::kMalwareList);
1064 browse_listnames.push_back(safe_browsing_util::kPhishingList); 1064 browse_listnames.push_back(safe_browsing_util::kPhishingList);
1065 UpdateChunkRanges(browse_store_.get(), browse_listnames, lists); 1065 UpdateChunkRanges(browse_store_.get(), browse_listnames, lists);
1066 1066
1067 if (download_store_.get()) { 1067 if (download_store_.get()) {
1068 std::vector<std::string> download_listnames; 1068 std::vector<std::string> download_listnames;
1069 download_listnames.push_back(safe_browsing_util::kBinUrlList); 1069 download_listnames.push_back(safe_browsing_util::kBinUrlList);
1070 download_listnames.push_back(safe_browsing_util::kBinHashList); 1070 download_listnames.push_back(safe_browsing_util::kBinHashList);
1071 UpdateChunkRanges(download_store_.get(), download_listnames, lists); 1071 UpdateChunkRanges(download_store_.get(), download_listnames, lists);
1072 DCHECK_EQ(lists->back().name,
1073 std::string(safe_browsing_util::kBinHashList));
1074 // Remove kBinHashList entry so that we do not request updates for it from
1075 // the server. The existing data will still be retained by
1076 // SafeBrowsingStoreFile::DoUpdate.
1077 // TODO(mattm): write some code to remove the kBinHashList data from the
1078 // file?
1079 lists->pop_back();
1072 } 1080 }
1073 1081
1074 if (csd_whitelist_store_.get()) { 1082 if (csd_whitelist_store_.get()) {
1075 std::vector<std::string> csd_whitelist_listnames; 1083 std::vector<std::string> csd_whitelist_listnames;
1076 csd_whitelist_listnames.push_back(safe_browsing_util::kCsdWhiteList); 1084 csd_whitelist_listnames.push_back(safe_browsing_util::kCsdWhiteList);
1077 UpdateChunkRanges(csd_whitelist_store_.get(), 1085 UpdateChunkRanges(csd_whitelist_store_.get(),
1078 csd_whitelist_listnames, lists); 1086 csd_whitelist_listnames, lists);
1079 } 1087 }
1080 1088
1081 if (download_whitelist_store_.get()) { 1089 if (download_whitelist_store_.get()) {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 if (std::binary_search(new_whitelist.begin(), new_whitelist.end(), 1438 if (std::binary_search(new_whitelist.begin(), new_whitelist.end(),
1431 kill_switch)) { 1439 kill_switch)) {
1432 // The kill switch is whitelisted hence we whitelist all URLs. 1440 // The kill switch is whitelisted hence we whitelist all URLs.
1433 WhitelistEverything(whitelist); 1441 WhitelistEverything(whitelist);
1434 } else { 1442 } else {
1435 base::AutoLock locked(lookup_lock_); 1443 base::AutoLock locked(lookup_lock_);
1436 whitelist->second = false; 1444 whitelist->second = false;
1437 whitelist->first.swap(new_whitelist); 1445 whitelist->first.swap(new_whitelist);
1438 } 1446 }
1439 } 1447 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698