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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/variations_seed_signature_analyzer.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 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/variations_seed_signat ure_analyzer.h" 5 #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signat ure_analyzer.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 19 matching lines...) Expand all
30 return; 30 return;
31 std::string invalid_signature = 31 std::string invalid_signature =
32 variations_service->GetInvalidVariationsSeedSignature(); 32 variations_service->GetInvalidVariationsSeedSignature();
33 if (!invalid_signature.empty()) { 33 if (!invalid_signature.empty()) {
34 std::unique_ptr< 34 std::unique_ptr<
35 ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident> 35 ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident>
36 variations_seed_signature( 36 variations_seed_signature(
37 new ClientIncidentReport_IncidentData_VariationsSeedSignatureInciden t()); 37 new ClientIncidentReport_IncidentData_VariationsSeedSignatureInciden t());
38 variations_seed_signature->set_variations_seed_signature(invalid_signature); 38 variations_seed_signature->set_variations_seed_signature(invalid_signature);
39 incident_receiver->AddIncidentForProcess( 39 incident_receiver->AddIncidentForProcess(
40 base::WrapUnique(new VariationsSeedSignatureIncident( 40 base::MakeUnique<VariationsSeedSignatureIncident>(
41 std::move(variations_seed_signature)))); 41 std::move(variations_seed_signature)));
42 } 42 }
43 } 43 }
44 44
45 } // namespace 45 } // namespace
46 46
47 void RegisterVariationsSeedSignatureAnalysis() { 47 void RegisterVariationsSeedSignatureAnalysis() {
48 scoped_refptr<SafeBrowsingService> safe_browsing_service( 48 scoped_refptr<SafeBrowsingService> safe_browsing_service(
49 g_browser_process->safe_browsing_service()); 49 g_browser_process->safe_browsing_service());
50 50
51 safe_browsing_service->RegisterDelayedAnalysisCallback( 51 safe_browsing_service->RegisterDelayedAnalysisCallback(
52 base::Bind(&VerifyVariationsSeedSignature)); 52 base::Bind(&VerifyVariationsSeedSignature));
53 } 53 }
54 54
55 void VerifyVariationsSeedSignature( 55 void VerifyVariationsSeedSignature(
56 std::unique_ptr<IncidentReceiver> incident_receiver) { 56 std::unique_ptr<IncidentReceiver> incident_receiver) {
57 content::BrowserThread::PostTask( 57 content::BrowserThread::PostTask(
58 content::BrowserThread::UI, 58 content::BrowserThread::UI,
59 FROM_HERE, 59 FROM_HERE,
60 base::Bind(&VerifyVariationsSeedSignatureOnUIThread, 60 base::Bind(&VerifyVariationsSeedSignatureOnUIThread,
61 base::Passed(&incident_receiver))); 61 base::Passed(&incident_receiver)));
62 } 62 }
63 63
64 } // namespace safe_browsing 64 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698