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

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

Issue 1643573002: Add a ModuleLoadAnalyzer which checks modules against a whitelist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix incorrect and misleading unit tests in for blacklist_load and suspicious_module incidents 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
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 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #if defined(SAFE_BROWSING_DB_LOCAL) 56 #if defined(SAFE_BROWSING_DB_LOCAL)
57 #include "chrome/browser/safe_browsing/local_database_manager.h" 57 #include "chrome/browser/safe_browsing/local_database_manager.h"
58 #elif defined(SAFE_BROWSING_DB_REMOTE) 58 #elif defined(SAFE_BROWSING_DB_REMOTE)
59 #include "components/safe_browsing_db/remote_database_manager.h" 59 #include "components/safe_browsing_db/remote_database_manager.h"
60 #endif 60 #endif
61 61
62 #if defined(FULL_SAFE_BROWSING) 62 #if defined(FULL_SAFE_BROWSING)
63 #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analy zer.h" 63 #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analy zer.h"
64 #include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyze r.h" 64 #include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyze r.h"
65 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser vice.h" 65 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser vice.h"
66 #include "chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.h "
66 #include "chrome/browser/safe_browsing/incident_reporting/resource_request_detec tor.h" 67 #include "chrome/browser/safe_browsing/incident_reporting/resource_request_detec tor.h"
67 #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signat ure_analyzer.h" 68 #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signat ure_analyzer.h"
68 #endif 69 #endif
69 70
70 using content::BrowserThread; 71 using content::BrowserThread;
71 72
72 namespace safe_browsing { 73 namespace safe_browsing {
73 74
74 namespace { 75 namespace {
75 76
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 #else 370 #else
370 return scoped_ptr<TrackedPreferenceValidationDelegate>(); 371 return scoped_ptr<TrackedPreferenceValidationDelegate>();
371 #endif 372 #endif
372 } 373 }
373 374
374 #if defined(FULL_SAFE_BROWSING) 375 #if defined(FULL_SAFE_BROWSING)
375 void SafeBrowsingService::RegisterDelayedAnalysisCallback( 376 void SafeBrowsingService::RegisterDelayedAnalysisCallback(
376 const DelayedAnalysisCallback& callback) { 377 const DelayedAnalysisCallback& callback) {
377 incident_service_->RegisterDelayedAnalysisCallback(callback); 378 incident_service_->RegisterDelayedAnalysisCallback(callback);
378 } 379 }
380
381 void SafeBrowsingService::RegisterExtendedReportingOnlyDelayedAnalysisCallback(
382 const DelayedAnalysisCallback& callback) {
383 incident_service_->RegisterExtendedReportingOnlyDelayedAnalysisCallback(
384 callback);
385 }
379 #endif 386 #endif
380 387
381 void SafeBrowsingService::AddDownloadManager( 388 void SafeBrowsingService::AddDownloadManager(
382 content::DownloadManager* download_manager) { 389 content::DownloadManager* download_manager) {
383 #if defined(FULL_SAFE_BROWSING) 390 #if defined(FULL_SAFE_BROWSING)
384 incident_service_->AddDownloadManager(download_manager); 391 incident_service_->AddDownloadManager(download_manager);
385 #endif 392 #endif
386 } 393 }
387 394
388 void SafeBrowsingService::OnResourceRequest(const net::URLRequest* request) { 395 void SafeBrowsingService::OnResourceRequest(const net::URLRequest* request) {
(...skipping 24 matching lines...) Expand all
413 SafeBrowsingService::CreateIncidentReportingService() { 420 SafeBrowsingService::CreateIncidentReportingService() {
414 return new IncidentReportingService( 421 return new IncidentReportingService(
415 this, url_request_context_getter_); 422 this, url_request_context_getter_);
416 } 423 }
417 #endif 424 #endif
418 425
419 void SafeBrowsingService::RegisterAllDelayedAnalysis() { 426 void SafeBrowsingService::RegisterAllDelayedAnalysis() {
420 #if defined(FULL_SAFE_BROWSING) 427 #if defined(FULL_SAFE_BROWSING)
421 RegisterBinaryIntegrityAnalysis(); 428 RegisterBinaryIntegrityAnalysis();
422 RegisterBlacklistLoadAnalysis(); 429 RegisterBlacklistLoadAnalysis();
430 RegisterModuleLoadAnalysis(database_manager_);
423 RegisterVariationsSeedSignatureAnalysis(); 431 RegisterVariationsSeedSignatureAnalysis();
424 #else 432 #else
425 NOTREACHED(); 433 NOTREACHED();
426 #endif 434 #endif
427 } 435 }
428 436
429 SafeBrowsingProtocolConfig SafeBrowsingService::GetProtocolConfig() const { 437 SafeBrowsingProtocolConfig SafeBrowsingService::GetProtocolConfig() const {
430 SafeBrowsingProtocolConfig config; 438 SafeBrowsingProtocolConfig config;
431 // On Windows, get the safe browsing client name from the browser 439 // On Windows, get the safe browsing client name from the browser
432 // distribution classes in installer util. These classes don't yet have 440 // distribution classes in installer util. These classes don't yet have
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 653 }
646 654
647 void SafeBrowsingService::OnSendDownloadRecoveryReport( 655 void SafeBrowsingService::OnSendDownloadRecoveryReport(
648 const std::string& report) { 656 const std::string& report) {
649 DCHECK_CURRENTLY_ON(BrowserThread::IO); 657 DCHECK_CURRENTLY_ON(BrowserThread::IO);
650 if (ping_manager()) 658 if (ping_manager())
651 ping_manager()->ReportThreatDetails(report); 659 ping_manager()->ReportThreatDetails(report);
652 } 660 }
653 661
654 } // namespace safe_browsing 662 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698