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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc

Issue 2259523003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698