OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signat ure_analyzer.h" | |
6 | |
7 #include <string> | |
8 | |
9 #include "chrome/browser/browser_process.h" | |
10 #include "chrome/browser/metrics/variations/variations_service.h" | |
11 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | |
12 #include "chrome/common/safe_browsing/csd.pb.h" | |
13 | |
14 namespace safe_browsing { | |
15 | |
16 void RegisterVariationsSeedSignatureAnalysis() { | |
17 scoped_refptr<SafeBrowsingService> safe_browsing_service( | |
18 g_browser_process->safe_browsing_service()); | |
19 | |
20 safe_browsing_service->RegisterDelayedAnalysisCallback( | |
21 base::Bind(&VerifyVariationsSeedSignature)); | |
22 } | |
23 | |
24 void VerifyVariationsSeedSignature(const AddIncidentCallback& callback) { | |
25 std::string invalid_signature = g_browser_process->variations_service() | |
Alexei Svitkine (slow)
2014/10/15 14:53:07
Nit: Wrap after =
Georges Khalil
2014/10/15 16:53:19
I tried, it won't fit. This is the output of git c
| |
26 ->GetInvalidVariationsSeedSignature(); | |
Alexei Svitkine (slow)
2014/10/15 14:55:56
Actually, one other thing - g_browser_process->var
Georges Khalil
2014/10/15 16:53:19
Done.
| |
27 if (!invalid_signature.empty()) { | |
28 scoped_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident_data( | |
29 new safe_browsing::ClientIncidentReport_IncidentData()); | |
30 safe_browsing:: | |
Alexei Svitkine (slow)
2014/10/15 14:53:07
Nit: No need for namespace here.
| |
31 ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* | |
32 variations_seed_signature = | |
33 incident_data->mutable_variations_seed_signature(); | |
34 variations_seed_signature->set_variations_seed_signature(invalid_signature); | |
35 callback.Run(incident_data.Pass()); | |
36 } | |
37 } | |
38 | |
39 } // namespace safe_browsing | |
OLD | NEW |