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

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

Issue 341553006: Delete prefix-set if side-effect-free whitelist not enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | no next file » | 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) 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 "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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 UMA_HISTOGRAM_TIMES("SB2.SideEffectFreeWhitelistPrefixSetLoad", 597 UMA_HISTOGRAM_TIMES("SB2.SideEffectFreeWhitelistPrefixSetLoad",
598 base::TimeTicks::Now() - before); 598 base::TimeTicks::Now() - before);
599 if (!side_effect_free_whitelist_prefix_set_.get()) 599 if (!side_effect_free_whitelist_prefix_set_.get())
600 RecordFailure(FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_READ); 600 RecordFailure(FAILURE_SIDE_EFFECT_FREE_WHITELIST_PREFIX_SET_READ);
601 } 601 }
602 } else { 602 } else {
603 // Delete any files of the side-effect free sidelist that may be around 603 // Delete any files of the side-effect free sidelist that may be around
604 // from when it was previously enabled. 604 // from when it was previously enabled.
605 SafeBrowsingStoreFile::DeleteStore( 605 SafeBrowsingStoreFile::DeleteStore(
606 SideEffectFreeWhitelistDBFilename(filename_base)); 606 SideEffectFreeWhitelistDBFilename(filename_base));
607 base::DeleteFile(
608 PrefixSetForFilename(SideEffectFreeWhitelistDBFilename(filename_base)),
609 false);
607 } 610 }
608 611
609 if (ip_blacklist_store_.get()) { 612 if (ip_blacklist_store_.get()) {
610 ip_blacklist_filename_ = IpBlacklistDBFilename(filename_base); 613 ip_blacklist_filename_ = IpBlacklistDBFilename(filename_base);
611 ip_blacklist_store_->Init( 614 ip_blacklist_store_->Init(
612 ip_blacklist_filename_, 615 ip_blacklist_filename_,
613 base::Bind(&SafeBrowsingDatabaseNew::HandleCorruptDatabase, 616 base::Bind(&SafeBrowsingDatabaseNew::HandleCorruptDatabase,
614 base::Unretained(this))); 617 base::Unretained(this)));
615 DVLOG(1) << "SafeBrowsingDatabaseNew read ip blacklist: " 618 DVLOG(1) << "SafeBrowsingDatabaseNew read ip blacklist: "
616 << ip_blacklist_filename_.value(); 619 << ip_blacklist_filename_.value();
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 bool SafeBrowsingDatabaseNew::IsMalwareIPMatchKillSwitchOn() { 1572 bool SafeBrowsingDatabaseNew::IsMalwareIPMatchKillSwitchOn() {
1570 SBFullHash malware_kill_switch = SBFullHashForString(kMalwareIPKillSwitchUrl); 1573 SBFullHash malware_kill_switch = SBFullHashForString(kMalwareIPKillSwitchUrl);
1571 std::vector<SBFullHash> full_hashes; 1574 std::vector<SBFullHash> full_hashes;
1572 full_hashes.push_back(malware_kill_switch); 1575 full_hashes.push_back(malware_kill_switch);
1573 return ContainsWhitelistedHashes(csd_whitelist_, full_hashes); 1576 return ContainsWhitelistedHashes(csd_whitelist_, full_hashes);
1574 } 1577 }
1575 1578
1576 bool SafeBrowsingDatabaseNew::IsCsdWhitelistKillSwitchOn() { 1579 bool SafeBrowsingDatabaseNew::IsCsdWhitelistKillSwitchOn() {
1577 return csd_whitelist_.second; 1580 return csd_whitelist_.second;
1578 } 1581 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698