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> |
11 | 11 |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "components/safe_browsing_db/v4_feature_list.h" | 16 #include "components/safe_browsing_db/v4_feature_list.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 | 18 |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
20 | 20 |
21 namespace safe_browsing { | 21 namespace safe_browsing { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 const ThreatSeverity kLeastSeverity = | 25 const ThreatSeverity kLeastSeverity = |
26 std::numeric_limits<ThreatSeverity>::max(); | 26 std::numeric_limits<ThreatSeverity>::max(); |
27 | 27 |
28 ListInfos GetListInfos() { | 28 ListInfos GetListInfos() { |
29 // NOTE(vakh): When adding a store here, add the corresponding store-specific | |
30 // histograms also. | |
Nathan Parker
2016/10/18 04:06:18
Add the name of the histogram(s) group so it's eas
| |
29 return ListInfos( | 31 return ListInfos( |
30 {ListInfo(true, "UrlMalware.store", GetUrlMalwareId(), | 32 {ListInfo(true, "UrlMalware.store", GetUrlMalwareId(), |
31 SB_THREAT_TYPE_URL_MALWARE), | 33 SB_THREAT_TYPE_URL_MALWARE), |
32 ListInfo(true, "UrlSoceng.store", GetUrlSocEngId(), | 34 ListInfo(true, "UrlSoceng.store", GetUrlSocEngId(), |
33 SB_THREAT_TYPE_URL_PHISHING), | 35 SB_THREAT_TYPE_URL_PHISHING), |
34 ListInfo(false, "", GetChromeUrlApiId(), SB_THREAT_TYPE_API_ABUSE)}); | 36 ListInfo(false, "", GetChromeUrlApiId(), SB_THREAT_TYPE_API_ABUSE)}); |
35 } | 37 } |
36 | 38 |
37 // Returns the severity information about a given SafeBrowsing list. The lowest | 39 // Returns the severity information about a given SafeBrowsing list. The lowest |
38 // value is 0, which represents the most severe list. | 40 // value is 0, which represents the most severe list. |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
486 } | 488 } |
487 | 489 |
488 void V4LocalDatabaseManager::UpdateRequestCompleted( | 490 void V4LocalDatabaseManager::UpdateRequestCompleted( |
489 std::unique_ptr<ParsedServerResponse> parsed_server_response) { | 491 std::unique_ptr<ParsedServerResponse> parsed_server_response) { |
490 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 492 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
491 v4_database_->ApplyUpdate(std::move(parsed_server_response), | 493 v4_database_->ApplyUpdate(std::move(parsed_server_response), |
492 db_updated_callback_); | 494 db_updated_callback_); |
493 } | 495 } |
494 | 496 |
495 } // namespace safe_browsing | 497 } // namespace safe_browsing |
OLD | NEW |