| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_mac.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analy
zer_mac.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 MacSignatureEvaluator evaluator(path, requirement); | 29 MacSignatureEvaluator evaluator(path, requirement); |
| 30 if (!evaluator.Initialize()) { | 30 if (!evaluator.Initialize()) { |
| 31 LOG(ERROR) << "Could not initialize mac signature evaluator"; | 31 LOG(ERROR) << "Could not initialize mac signature evaluator"; |
| 32 return; | 32 return; |
| 33 } | 33 } |
| 34 | 34 |
| 35 std::unique_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> | 35 std::unique_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident> |
| 36 incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident()); | 36 incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident()); |
| 37 if (!evaluator.PerformEvaluation(incident.get())) { | 37 if (!evaluator.PerformEvaluation(incident.get())) { |
| 38 incident_receiver->AddIncidentForProcess( | 38 incident_receiver->AddIncidentForProcess( |
| 39 base::WrapUnique(new BinaryIntegrityIncident(std::move(incident)))); | 39 base::MakeUnique<BinaryIntegrityIncident>(std::move(incident))); |
| 40 } else { | 40 } else { |
| 41 // Clear past incidents involving this bundle if the signature is | 41 // Clear past incidents involving this bundle if the signature is |
| 42 // now valid. | 42 // now valid. |
| 43 ClearBinaryIntegrityForFile(incident_receiver, path.BaseName().value()); | 43 ClearBinaryIntegrityForFile(incident_receiver, path.BaseName().value()); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 std::vector<PathAndRequirement> GetCriticalPathsAndRequirements() { | 49 std::vector<PathAndRequirement> GetCriticalPathsAndRequirements() { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 74 std::unique_ptr<IncidentReceiver> incident_receiver) { | 74 std::unique_ptr<IncidentReceiver> incident_receiver) { |
| 75 size_t i = 0; | 75 size_t i = 0; |
| 76 for (const auto& p : GetCriticalPathsAndRequirements()) { | 76 for (const auto& p : GetCriticalPathsAndRequirements()) { |
| 77 base::TimeTicks time_before = base::TimeTicks::Now(); | 77 base::TimeTicks time_before = base::TimeTicks::Now(); |
| 78 VerifyBinaryIntegrityHelper(incident_receiver.get(), p.path, p.requirement); | 78 VerifyBinaryIntegrityHelper(incident_receiver.get(), p.path, p.requirement); |
| 79 RecordSignatureVerificationTime(i++, base::TimeTicks::Now() - time_before); | 79 RecordSignatureVerificationTime(i++, base::TimeTicks::Now() - time_before); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace | 83 } // namespace |
| OLD | NEW |