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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service.h

Issue 516663002: Introducing the OffDomainInclusionDetector to analyze resource requests for suspicious activity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Base analysis off of second-level domain only. Created 6 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // The Safe Browsing service is responsible for downloading anti-phishing and 5 // The Safe Browsing service is responsible for downloading anti-phishing and
6 // anti-malware tables and checking urls against them. 6 // anti-malware tables and checking urls against them.
7 7
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_
9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ 9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_
10 10
11 #include <map> 11 #include <map>
12 #include <string> 12 #include <string>
13 13
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/observer_list.h" 18 #include "base/observer_list.h"
19 #include "base/sequenced_task_runner_helpers.h" 19 #include "base/sequenced_task_runner_helpers.h"
20 #include "chrome/browser/safe_browsing/incident_reporting/delayed_analysis_callb ack.h" 20 #include "chrome/browser/safe_browsing/incident_reporting/delayed_analysis_callb ack.h"
21 #include "chrome/browser/safe_browsing/off_domain_inclusion_detector.h"
21 #include "chrome/browser/safe_browsing/safe_browsing_util.h" 22 #include "chrome/browser/safe_browsing/safe_browsing_util.h"
22 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
23 #include "content/public/browser/notification_observer.h" 24 #include "content/public/browser/notification_observer.h"
24 #include "content/public/browser/notification_registrar.h" 25 #include "content/public/browser/notification_registrar.h"
26 #include "content/public/common/resource_type.h"
25 27
26 class PrefChangeRegistrar; 28 class PrefChangeRegistrar;
27 class PrefService; 29 class PrefService;
28 class Profile; 30 class Profile;
29 struct SafeBrowsingProtocolConfig; 31 struct SafeBrowsingProtocolConfig;
30 class SafeBrowsingDatabaseManager; 32 class SafeBrowsingDatabaseManager;
31 class SafeBrowsingPingManager; 33 class SafeBrowsingPingManager;
32 class SafeBrowsingProtocolManager; 34 class SafeBrowsingProtocolManager;
33 class SafeBrowsingServiceFactory; 35 class SafeBrowsingServiceFactory;
34 class SafeBrowsingUIManager; 36 class SafeBrowsingUIManager;
35 class SafeBrowsingURLRequestContextGetter; 37 class SafeBrowsingURLRequestContextGetter;
36 class TrackedPreferenceValidationDelegate; 38 class TrackedPreferenceValidationDelegate;
37 39
38 namespace base { 40 namespace base {
39 class Thread; 41 class Thread;
40 } 42 }
41 43
42 namespace net { 44 namespace net {
45 class URLRequest;
43 class URLRequestContext; 46 class URLRequestContext;
44 class URLRequestContextGetter; 47 class URLRequestContextGetter;
45 } 48 }
46 49
47 namespace safe_browsing { 50 namespace safe_browsing {
48 class ClientSideDetectionService; 51 class ClientSideDetectionService;
49 class DownloadProtectionService; 52 class DownloadProtectionService;
50 class IncidentReportingService; 53 class IncidentReportingService;
51 } 54 }
52 55
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // service is not applicable for the given profile. 127 // service is not applicable for the given profile.
125 scoped_ptr<TrackedPreferenceValidationDelegate> 128 scoped_ptr<TrackedPreferenceValidationDelegate>
126 CreatePreferenceValidationDelegate(Profile* profile) const; 129 CreatePreferenceValidationDelegate(Profile* profile) const;
127 130
128 // Registers |callback| to be run after some delay following process launch. 131 // Registers |callback| to be run after some delay following process launch.
129 // |callback| will be dropped if the service is not applicable for the 132 // |callback| will be dropped if the service is not applicable for the
130 // process. 133 // process.
131 void RegisterDelayedAnalysisCallback( 134 void RegisterDelayedAnalysisCallback(
132 const safe_browsing::DelayedAnalysisCallback& callback); 135 const safe_browsing::DelayedAnalysisCallback& callback);
133 136
137 // Oserves resource requests made by the renderer and reports suspsicious
138 // activity.
139 void OnResourceRequest(const net::URLRequest* request,
140 content::ResourceType resource_type);
141
134 protected: 142 protected:
135 // Creates the safe browsing service. Need to initialize before using. 143 // Creates the safe browsing service. Need to initialize before using.
136 SafeBrowsingService(); 144 SafeBrowsingService();
137 145
138 virtual ~SafeBrowsingService(); 146 virtual ~SafeBrowsingService();
139 147
140 virtual SafeBrowsingDatabaseManager* CreateDatabaseManager(); 148 virtual SafeBrowsingDatabaseManager* CreateDatabaseManager();
141 149
142 virtual SafeBrowsingUIManager* CreateUIManager(); 150 virtual SafeBrowsingUIManager* CreateUIManager();
143 151
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 scoped_ptr<safe_browsing::IncidentReportingService> incident_service_; 248 scoped_ptr<safe_browsing::IncidentReportingService> incident_service_;
241 249
242 // The UI manager handles showing interstitials. Accessed on both UI and IO 250 // The UI manager handles showing interstitials. Accessed on both UI and IO
243 // thread. 251 // thread.
244 scoped_refptr<SafeBrowsingUIManager> ui_manager_; 252 scoped_refptr<SafeBrowsingUIManager> ui_manager_;
245 253
246 // The database manager handles the database and download logic. Accessed on 254 // The database manager handles the database and download logic. Accessed on
247 // both UI and IO thread. 255 // both UI and IO thread.
248 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; 256 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
249 257
258 safe_browsing::OffDomainInclusionDetector off_domain_inclusion_detector_;
259
250 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); 260 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService);
251 }; 261 };
252 262
253 // Factory for creating SafeBrowsingService. Useful for tests. 263 // Factory for creating SafeBrowsingService. Useful for tests.
254 class SafeBrowsingServiceFactory { 264 class SafeBrowsingServiceFactory {
255 public: 265 public:
256 SafeBrowsingServiceFactory() { } 266 SafeBrowsingServiceFactory() { }
257 virtual ~SafeBrowsingServiceFactory() { } 267 virtual ~SafeBrowsingServiceFactory() { }
258 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; 268 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0;
259 private: 269 private:
260 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); 270 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory);
261 }; 271 };
262 272
263 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ 273 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698