| OLD | NEW |
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // value is 0, which represents the most severe list. | 82 // value is 0, which represents the most severe list. |
| 83 ThreatSeverity GetThreatSeverity(const ListIdentifier& list_id) { | 83 ThreatSeverity GetThreatSeverity(const ListIdentifier& list_id) { |
| 84 switch (list_id.threat_type()) { | 84 switch (list_id.threat_type()) { |
| 85 case MALWARE_THREAT: | 85 case MALWARE_THREAT: |
| 86 case SOCIAL_ENGINEERING_PUBLIC: | 86 case SOCIAL_ENGINEERING_PUBLIC: |
| 87 case MALICIOUS_BINARY: | 87 case MALICIOUS_BINARY: |
| 88 return 0; | 88 return 0; |
| 89 case UNWANTED_SOFTWARE: | 89 case UNWANTED_SOFTWARE: |
| 90 return 1; | 90 return 1; |
| 91 case API_ABUSE: | 91 case API_ABUSE: |
| 92 case CLIENT_INCIDENT: |
| 92 return 2; | 93 return 2; |
| 93 default: | 94 |
| 95 case THREAT_TYPE_UNSPECIFIED: |
| 96 case POTENTIALLY_HARMFUL_APPLICATION: |
| 97 case SOCIAL_ENGINEERING: |
| 98 case CSD_WHITELIST: |
| 99 case CSD_DOWNLOAD_WHITELIST: |
| 100 case SUBRESOURCE_FILTER: |
| 94 NOTREACHED() << "Unexpected ThreatType encountered: " | 101 NOTREACHED() << "Unexpected ThreatType encountered: " |
| 95 << list_id.threat_type(); | 102 << list_id.threat_type(); |
| 96 return kLeastSeverity; | 103 return kLeastSeverity; |
| 97 } | 104 } |
| 98 } | 105 } |
| 99 | 106 |
| 100 } // namespace | 107 } // namespace |
| 101 | 108 |
| 102 V4LocalDatabaseManager::PendingCheck::PendingCheck( | 109 V4LocalDatabaseManager::PendingCheck::PendingCheck( |
| 103 Client* client, | 110 Client* client, |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 db_updated_callback_); | 745 db_updated_callback_); |
| 739 } | 746 } |
| 740 | 747 |
| 741 bool V4LocalDatabaseManager::AreStoresAvailableNow( | 748 bool V4LocalDatabaseManager::AreStoresAvailableNow( |
| 742 const StoresToCheck& stores_to_check) const { | 749 const StoresToCheck& stores_to_check) const { |
| 743 return enabled_ && v4_database_ && | 750 return enabled_ && v4_database_ && |
| 744 v4_database_->AreStoresAvailable(stores_to_check); | 751 v4_database_->AreStoresAvailable(stores_to_check); |
| 745 } | 752 } |
| 746 | 753 |
| 747 } // namespace safe_browsing | 754 } // namespace safe_browsing |
| OLD | NEW |