| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/binary_integrity_analy
zer.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analy
zer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 signature_verification_time_histogram->AddTime(verification_time); | 39 signature_verification_time_histogram->AddTime(verification_time); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void ClearBinaryIntegrityForFile(IncidentReceiver* incident_receiver, | 42 void ClearBinaryIntegrityForFile(IncidentReceiver* incident_receiver, |
| 43 const std::string& basename) { | 43 const std::string& basename) { |
| 44 std::unique_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> | 44 std::unique_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> |
| 45 incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident()); | 45 incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident()); |
| 46 incident->set_file_basename(basename); | 46 incident->set_file_basename(basename); |
| 47 incident_receiver->ClearIncidentForProcess( | 47 incident_receiver->ClearIncidentForProcess( |
| 48 base::WrapUnique(new BinaryIntegrityIncident(std::move(incident)))); | 48 base::MakeUnique<BinaryIntegrityIncident>(std::move(incident))); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void RegisterBinaryIntegrityAnalysis() { | 51 void RegisterBinaryIntegrityAnalysis() { |
| 52 #if defined(OS_WIN) || defined(OS_MACOSX) | 52 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 53 scoped_refptr<SafeBrowsingService> safe_browsing_service( | 53 scoped_refptr<SafeBrowsingService> safe_browsing_service( |
| 54 g_browser_process->safe_browsing_service()); | 54 g_browser_process->safe_browsing_service()); |
| 55 | 55 |
| 56 safe_browsing_service->RegisterDelayedAnalysisCallback( | 56 safe_browsing_service->RegisterDelayedAnalysisCallback( |
| 57 base::Bind(&VerifyBinaryIntegrity)); | 57 base::Bind(&VerifyBinaryIntegrity)); |
| 58 #endif | 58 #endif |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace safe_browsing | 61 } // namespace safe_browsing |
| OLD | NEW |