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

Side by Side Diff: chrome/browser/metrics/antivirus_metrics_provider_win.h

Issue 2631583002: Trim version and extraneus parts from AntiVirus product names. (Closed)
Patch Set: Created 3 years, 11 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
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 #ifndef CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ 5 #ifndef CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_
6 #define CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ 6 #define CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_
7 7
8 #include "components/metrics/metrics_provider.h" 8 #include "components/metrics/metrics_provider.h"
9 9
10 #include <iwscapi.h> 10 #include <iwscapi.h>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 static ResultCode FillAntiVirusProductsFromWMI( 78 static ResultCode FillAntiVirusProductsFromWMI(
79 std::vector<AvProduct>* products); 79 std::vector<AvProduct>* products);
80 80
81 // Query local machine configuration for other products that might not be 81 // Query local machine configuration for other products that might not be
82 // registered in WMI or Security Center and add them to the product vector. 82 // registered in WMI or Security Center and add them to the product vector.
83 static void MaybeAddUnregisteredAntiVirusProducts( 83 static void MaybeAddUnregisteredAntiVirusProducts(
84 std::vector<AvProduct>* products); 84 std::vector<AvProduct>* products);
85 85
86 static std::vector<AvProduct> GetAntiVirusProductsOnFileThread(); 86 static std::vector<AvProduct> GetAntiVirusProductsOnFileThread();
87 87
88 static std::string TrimVersionOfAvProductName(const std::string& av_product);
rkaplow 2017/01/12 23:18:56 hm, I'd add a small comment on some idea of what k
Will Harris 2017/01/12 23:23:59 Acknowledged. Once we agree what the algorithm is
Will Harris 2017/01/12 23:39:06 Done.
89
88 // Called when metrics are done being gathered from the FILE thread. 90 // Called when metrics are done being gathered from the FILE thread.
89 // |done_callback| is the callback that should be called once all metrics are 91 // |done_callback| is the callback that should be called once all metrics are
90 // gathered. 92 // gathered.
91 void GotAntiVirusProducts(const base::Closure& done_callback, 93 void GotAntiVirusProducts(const base::Closure& done_callback,
92 const std::vector<AvProduct>& av_products); 94 const std::vector<AvProduct>& av_products);
93 95
94 // The TaskRunner on which file operations are performed (supplied by the 96 // The TaskRunner on which file operations are performed (supplied by the
95 // embedder). 97 // embedder).
96 scoped_refptr<base::TaskRunner> task_runner_; 98 scoped_refptr<base::TaskRunner> task_runner_;
97 99
98 // Information on installed AntiVirus gathered. 100 // Information on installed AntiVirus gathered.
99 std::vector<AvProduct> av_products_; 101 std::vector<AvProduct> av_products_;
100 102
101 base::ThreadChecker thread_checker_; 103 base::ThreadChecker thread_checker_;
102 base::WeakPtrFactory<AntiVirusMetricsProvider> weak_ptr_factory_; 104 base::WeakPtrFactory<AntiVirusMetricsProvider> weak_ptr_factory_;
103 105
104 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderTest, GetMetricsFullName); 106 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderTest, GetMetricsFullName);
107 FRIEND_TEST_ALL_PREFIXES(AntiVirusMetricsProviderSimpleTest,
108 StripProductVersion);
105 109
106 DISALLOW_COPY_AND_ASSIGN(AntiVirusMetricsProvider); 110 DISALLOW_COPY_AND_ASSIGN(AntiVirusMetricsProvider);
107 }; 111 };
108 112
109 #endif // CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_ 113 #endif // CHROME_BROWSER_METRICS_ANTIVIRUS_METRICS_PROVIDER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698