Chromium Code Reviews| 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 "chrome/browser/browser_process.h" | |
| 8 #include "chrome/browser/metrics/variations/variations_service.h" | |
| 9 #include "chrome/browser/safe_browsing/incident_reporting/add_incident_callback. h" | |
|
grt (UTC plus 2)
2014/10/14 01:28:30
already included in .h
Georges Khalil
2014/10/14 13:51:10
Done.
| |
| 10 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | |
| 11 #include "chrome/common/safe_browsing/csd.pb.h" | |
| 12 | |
| 13 namespace safe_browsing { | |
| 14 | |
| 15 void RegisterVariationsSeedSignatureAnalysis() { | |
| 16 scoped_refptr<SafeBrowsingService> safe_browsing_service( | |
| 17 g_browser_process->safe_browsing_service()); | |
| 18 | |
| 19 safe_browsing_service->RegisterDelayedAnalysisCallback( | |
| 20 base::Bind(&VerifyVariationsSeedSignature)); | |
| 21 } | |
| 22 | |
| 23 void VerifyVariationsSeedSignature(const AddIncidentCallback& callback) { | |
| 24 std::string invalid_signature; | |
| 25 if (g_browser_process->variations_service()->IsVariationsSeedSignatureInvalid( | |
| 26 &invalid_signature)) { | |
| 27 scoped_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident_data( | |
| 28 new safe_browsing::ClientIncidentReport_IncidentData()); | |
| 29 safe_browsing:: | |
| 30 ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* | |
| 31 variations_seed_signature = | |
| 32 incident_data->mutable_variations_seed_signature(); | |
| 33 variations_seed_signature->set_variations_seed_signature(invalid_signature); | |
| 34 callback.Run(incident_data.Pass()); | |
| 35 } | |
| 36 } | |
| 37 | |
| 38 } // namespace safe_browsing | |
| OLD | NEW |