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

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

Issue 2423523003: Small: Add store specific histograms also. (Closed)
Patch Set: Update the comment about histogram naming Created 4 years, 2 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_store.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>
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.
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 ListInfo(true, "UrlUws.store", GetUrlUwsId(), 37 ListInfo(true, "UrlUws.store", GetUrlUwsId(),
36 SB_THREAT_TYPE_URL_UNWANTED)}); 38 SB_THREAT_TYPE_URL_UNWANTED)});
37 } 39 }
38 40
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } 496 }
495 497
496 void V4LocalDatabaseManager::UpdateRequestCompleted( 498 void V4LocalDatabaseManager::UpdateRequestCompleted(
497 std::unique_ptr<ParsedServerResponse> parsed_server_response) { 499 std::unique_ptr<ParsedServerResponse> parsed_server_response) {
498 DCHECK_CURRENTLY_ON(BrowserThread::IO); 500 DCHECK_CURRENTLY_ON(BrowserThread::IO);
499 v4_database_->ApplyUpdate(std::move(parsed_server_response), 501 v4_database_->ApplyUpdate(std::move(parsed_server_response),
500 db_updated_callback_); 502 db_updated_callback_);
501 } 503 }
502 504
503 } // namespace safe_browsing 505 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698