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

Side by Side Diff: components/safe_browsing_db/v4_local_database_manager.cc

Issue 2687043003: GetThreatSeverity should handle the case of CheckResourceUrl. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // This file should not be build on Android but is currently getting built. 5 // This file should not be build on Android but is currently getting built.
6 // TODO(vakh): Fix that: http://crbug.com/621647 6 // TODO(vakh): Fix that: http://crbug.com/621647
7 7
8 #include "components/safe_browsing_db/v4_local_database_manager.h" 8 #include "components/safe_browsing_db/v4_local_database_manager.h"
9 9
10 #include <vector> 10 #include <vector>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // value is 0, which represents the most severe list. 80 // value is 0, which represents the most severe list.
81 ThreatSeverity GetThreatSeverity(const ListIdentifier& list_id) { 81 ThreatSeverity GetThreatSeverity(const ListIdentifier& list_id) {
82 switch (list_id.threat_type()) { 82 switch (list_id.threat_type()) {
83 case MALWARE_THREAT: 83 case MALWARE_THREAT:
84 case SOCIAL_ENGINEERING_PUBLIC: 84 case SOCIAL_ENGINEERING_PUBLIC:
85 case MALICIOUS_BINARY: 85 case MALICIOUS_BINARY:
86 return 0; 86 return 0;
87 case UNWANTED_SOFTWARE: 87 case UNWANTED_SOFTWARE:
88 return 1; 88 return 1;
89 case API_ABUSE: 89 case API_ABUSE:
90 case CLIENT_INCIDENT:
90 return 2; 91 return 2;
91 default: 92 default:
92 NOTREACHED() << "Unexpected ThreatType encountered: " 93 NOTREACHED() << "Unexpected ThreatType encountered: "
93 << list_id.threat_type(); 94 << list_id.threat_type();
94 return kLeastSeverity; 95 return kLeastSeverity;
95 } 96 }
96 } 97 }
97 98
98 } // namespace 99 } // namespace
99 100
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 db_updated_callback_); 730 db_updated_callback_);
730 } 731 }
731 732
732 bool V4LocalDatabaseManager::AreStoresAvailableNow( 733 bool V4LocalDatabaseManager::AreStoresAvailableNow(
733 const StoresToCheck& stores_to_check) const { 734 const StoresToCheck& stores_to_check) const {
734 return enabled_ && v4_database_ && 735 return enabled_ && v4_database_ &&
735 v4_database_->AreStoresAvailable(stores_to_check); 736 v4_database_->AreStoresAvailable(stores_to_check);
736 } 737 }
737 738
738 } // namespace safe_browsing 739 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698