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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.h

Issue 1643573002: Add a ModuleLoadAnalyzer which checks modules against a whitelist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/soon when/soon as Created 4 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MODULE_LOAD_ANALYZER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MODULE_LOAD_ANALYZER_H_
7
8 #include <vector>
9
10 #include "base/feature_list.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h"
14 #include "base/strings/string16.h"
15 #include "components/safe_browsing_db/database_manager.h"
16
17 namespace safe_browsing {
18
19 class IncidentReceiver;
20
21 #if defined(OS_WIN)
22 extern const base::Feature kIncidentReportingModuleLoadAnalysis;
23 #endif // defined(OS_WIN)
24
25 class ModuleLoadAnalyzer {
26 public:
27 // Constructs an ModuleLoadAnalyzer which will use |database_manager|
28 // over the course of its lifetime. The ModuleLoadAnalyzer will check for
29 // suspicious modules loaded in Chrome.
30 explicit ModuleLoadAnalyzer(
31 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager);
32 ~ModuleLoadAnalyzer();
33
34 // Callback to pass to the incident reporting service. The incident reporting
35 // service will decide when to start the analysis. Visible for testing.
36 void VerifyModuleLoadState(scoped_ptr<IncidentReceiver> incident_receiver);
37
38 private:
39 void Initialize();
40
41 // Returns the names of suspicious modules that are loaded in the process.
42 void GetLoadedSuspiciousModulesOnIOThread(
43 scoped_ptr<IncidentReceiver> incident_receiver);
44
45 // Creates and reports |SuspiciousModuleIncident| to the incident_receiver.
46 static void ReportIncidentsForSuspiciousModules(
47 scoped_ptr<std::set<base::string16>> module_names,
48 scoped_ptr<IncidentReceiver> incident_receiver);
49
50 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
51
52 DISALLOW_COPY_AND_ASSIGN(ModuleLoadAnalyzer);
53 };
54
55 } // namespace safe_browsing
56
57 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MODULE_LOAD_ANALYZER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698