| OLD | NEW |
| 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 #include "chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.h
" | 5 #include "chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.h
" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // Image headers. | 74 // Image headers. |
| 75 if (!binary_feature_extractor->ExtractImageFeatures( | 75 if (!binary_feature_extractor->ExtractImageFeatures( |
| 76 module_path, BinaryFeatureExtractor::kDefaultOptions, | 76 module_path, BinaryFeatureExtractor::kDefaultOptions, |
| 77 suspicious_module->mutable_image_headers(), | 77 suspicious_module->mutable_image_headers(), |
| 78 nullptr /* signed_data */)) { | 78 nullptr /* signed_data */)) { |
| 79 suspicious_module->clear_image_headers(); | 79 suspicious_module->clear_image_headers(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Send the incident to the reporting service. | 82 // Send the incident to the reporting service. |
| 83 incident_receiver->AddIncidentForProcess(base::WrapUnique( | 83 incident_receiver->AddIncidentForProcess( |
| 84 new SuspiciousModuleIncident(std::move(suspicious_module)))); | 84 base::MakeUnique<SuspiciousModuleIncident>( |
| 85 std::move(suspicious_module))); |
| 85 } | 86 } |
| 86 } | 87 } |
| 87 | 88 |
| 88 void CheckModuleWhitelistOnIOThread( | 89 void CheckModuleWhitelistOnIOThread( |
| 89 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager, | 90 const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager, |
| 90 std::unique_ptr<IncidentReceiver> incident_receiver, | 91 std::unique_ptr<IncidentReceiver> incident_receiver, |
| 91 std::unique_ptr<std::set<ModuleInfo>> module_info_set) { | 92 std::unique_ptr<std::set<ModuleInfo>> module_info_set) { |
| 92 SCOPED_UMA_HISTOGRAM_TIMER("SBIRS.SuspiciousModuleDetectionTime"); | 93 SCOPED_UMA_HISTOGRAM_TIMER("SBIRS.SuspiciousModuleDetectionTime"); |
| 93 std::unique_ptr<std::set<base::FilePath>> suspicious_paths( | 94 std::unique_ptr<std::set<base::FilePath>> suspicious_paths( |
| 94 new std::set<base::FilePath>); | 95 new std::set<base::FilePath>); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // PostTaskAndReply doesn't work here because we're in a sequenced blocking | 132 // PostTaskAndReply doesn't work here because we're in a sequenced blocking |
| 132 // thread pool. | 133 // thread pool. |
| 133 content::BrowserThread::PostTask( | 134 content::BrowserThread::PostTask( |
| 134 content::BrowserThread::IO, FROM_HERE, | 135 content::BrowserThread::IO, FROM_HERE, |
| 135 base::Bind(&CheckModuleWhitelistOnIOThread, database_manager, | 136 base::Bind(&CheckModuleWhitelistOnIOThread, database_manager, |
| 136 base::Passed(std::move(incident_receiver)), | 137 base::Passed(std::move(incident_receiver)), |
| 137 base::Passed(std::move(module_info_set)))); | 138 base::Passed(std::move(module_info_set)))); |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace safe_browsing | 141 } // namespace safe_browsing |
| OLD | NEW |