Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 // histograms also. | 33 // histograms also. | 
| 34 // NOTE(vakh): Delete file "AnyIpMalware.store". It has been renamed to | 34 // NOTE(vakh): Delete file "AnyIpMalware.store". It has been renamed to | 
| 35 // "IpMalware.store". If it exists, it should be 75 bytes long. | 35 // "IpMalware.store". If it exists, it should be 75 bytes long. | 
| 36 // The first argument to ListInfo specifies whether to sync hash prefixes for | 36 // The first argument to ListInfo specifies whether to sync hash prefixes for | 
| 37 // that list. This can be false for two reasons: | 37 // that list. This can be false for two reasons: | 
| 38 // - The server doesn't support that list yet. Once the server adds support | 38 // - The server doesn't support that list yet. Once the server adds support | 
| 39 // for it, it can be changed to true. | 39 // for it, it can be changed to true. | 
| 40 // - The list doesn't have hash prefixes to match. All requests lead to full | 40 // - The list doesn't have hash prefixes to match. All requests lead to full | 
| 41 // hash checks. For instance: GetChromeUrlApiId() | 41 // hash checks. For instance: GetChromeUrlApiId() | 
| 42 return ListInfos({ | 42 return ListInfos({ | 
| 43 ListInfo(false, "CertCsdDownloadWhitelist.store", | 43 ListInfo(EnableInternalLists(), "CertCsdDownloadWhitelist.store", | 
| 
 
Nathan Parker
2016/11/29 18:45:33
By setting fetch_updates=false for these, we're st
 
vakh (use Gerrit instead)
2016/11/29 20:24:49
but I'm not sure about ChromeFileNameClientInciden
 
vakh (use Gerrit instead)
2016/11/29 21:00:13
Done.
 
 | |
| 44 GetCertCsdDownloadWhitelistId(), SB_THREAT_TYPE_UNUSED), | 44 GetCertCsdDownloadWhitelistId(), SB_THREAT_TYPE_UNUSED), | 
| 45 ListInfo(false, "ChromeFilenameClientIncident.store", | 45 ListInfo(EnableInternalLists(), "ChromeFilenameClientIncident.store", | 
| 46 GetChromeFilenameClientIncidentId(), SB_THREAT_TYPE_UNUSED), | 46 GetChromeFilenameClientIncidentId(), SB_THREAT_TYPE_UNUSED), | 
| 47 ListInfo(true, "IpMalware.store", GetIpMalwareId(), | 47 ListInfo(true, "IpMalware.store", GetIpMalwareId(), | 
| 48 SB_THREAT_TYPE_UNUSED), | 48 SB_THREAT_TYPE_UNUSED), | 
| 49 ListInfo(false, "UrlCsdDownloadWhitelist.store", | 49 ListInfo(EnableInternalLists(), "UrlCsdDownloadWhitelist.store", | 
| 50 GetUrlCsdDownloadWhitelistId(), SB_THREAT_TYPE_UNUSED), | 50 GetUrlCsdDownloadWhitelistId(), SB_THREAT_TYPE_UNUSED), | 
| 51 ListInfo(false, "UrlCsdWhitelist.store", GetUrlCsdWhitelistId(), | 51 ListInfo(EnableInternalLists(), "UrlCsdWhitelist.store", | 
| 52 SB_THREAT_TYPE_UNUSED), | 52 GetUrlCsdWhitelistId(), SB_THREAT_TYPE_UNUSED), | 
| 53 ListInfo(true, "UrlSoceng.store", GetUrlSocEngId(), | 53 ListInfo(true, "UrlSoceng.store", GetUrlSocEngId(), | 
| 54 SB_THREAT_TYPE_URL_PHISHING), | 54 SB_THREAT_TYPE_URL_PHISHING), | 
| 55 ListInfo(true, "UrlMalware.store", GetUrlMalwareId(), | 55 ListInfo(true, "UrlMalware.store", GetUrlMalwareId(), | 
| 56 SB_THREAT_TYPE_URL_MALWARE), | 56 SB_THREAT_TYPE_URL_MALWARE), | 
| 57 ListInfo(true, "UrlUws.store", GetUrlUwsId(), | 57 ListInfo(true, "UrlUws.store", GetUrlUwsId(), | 
| 58 SB_THREAT_TYPE_URL_UNWANTED), | 58 SB_THREAT_TYPE_URL_UNWANTED), | 
| 59 ListInfo(true, "UrlMalBin.store", GetUrlMalBinId(), | 59 ListInfo(true, "UrlMalBin.store", GetUrlMalBinId(), | 
| 60 SB_THREAT_TYPE_BINARY_MALWARE_URL), | 60 SB_THREAT_TYPE_BINARY_MALWARE_URL), | 
| 61 ListInfo(true, "ChromeExtMalware.store", GetChromeExtensionMalwareId(), | 61 ListInfo(true, "ChromeExtMalware.store", GetChromeExtensionMalwareId(), | 
| 62 SB_THREAT_TYPE_EXTENSION), | 62 SB_THREAT_TYPE_EXTENSION), | 
| 63 ListInfo(false, "ChromeUrlClientIncident.store", | 63 ListInfo(EnableInternalLists(), "ChromeUrlClientIncident.store", | 
| 64 GetChromeUrlClientIncidentId(), | 64 GetChromeUrlClientIncidentId(), | 
| 65 SB_THREAT_TYPE_BLACKLISTED_RESOURCE), | 65 SB_THREAT_TYPE_BLACKLISTED_RESOURCE), | 
| 66 ListInfo(false, "", GetChromeUrlApiId(), SB_THREAT_TYPE_API_ABUSE), | 66 ListInfo(false, "", GetChromeUrlApiId(), SB_THREAT_TYPE_API_ABUSE), | 
| 67 }); | 67 }); | 
| 68 } | 68 } | 
| 69 | 69 | 
| 70 // Returns the severity information about a given SafeBrowsing list. The lowest | 70 // Returns the severity information about a given SafeBrowsing list. The lowest | 
| 71 // value is 0, which represents the most severe list. | 71 // value is 0, which represents the most severe list. | 
| 72 ThreatSeverity GetThreatSeverity(const ListIdentifier& list_id) { | 72 ThreatSeverity GetThreatSeverity(const ListIdentifier& list_id) { | 
| 73 switch (list_id.threat_type()) { | 73 switch (list_id.threat_type()) { | 
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 650 } | 650 } | 
| 651 | 651 | 
| 652 void V4LocalDatabaseManager::UpdateRequestCompleted( | 652 void V4LocalDatabaseManager::UpdateRequestCompleted( | 
| 653 std::unique_ptr<ParsedServerResponse> parsed_server_response) { | 653 std::unique_ptr<ParsedServerResponse> parsed_server_response) { | 
| 654 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 654 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| 655 v4_database_->ApplyUpdate(std::move(parsed_server_response), | 655 v4_database_->ApplyUpdate(std::move(parsed_server_response), | 
| 656 db_updated_callback_); | 656 db_updated_callback_); | 
| 657 } | 657 } | 
| 658 | 658 | 
| 659 } // namespace safe_browsing | 659 } // namespace safe_browsing | 
| OLD | NEW |