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

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

Issue 646733002: Added incident report for variations seed signature mismatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Responded to comments. Created 6 years, 2 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
(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 if (g_browser_process->variations_service() == nullptr) {
grt (UTC plus 2) 2014/10/15 17:29:42 nit: omit braces when the body is a single line.
Georges Khalil 2014/10/16 13:21:27 Done.
26 return;
27 }
28 std::string invalid_signature = g_browser_process->variations_service()
29 ->GetInvalidVariationsSeedSignature();
30 if (!invalid_signature.empty()) {
31 scoped_ptr<ClientIncidentReport_IncidentData> incident_data(
32 new ClientIncidentReport_IncidentData());
33 ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident*
34 variations_seed_signature =
35 incident_data->mutable_variations_seed_signature();
36 variations_seed_signature->set_variations_seed_signature(invalid_signature);
37 callback.Run(incident_data.Pass());
38 }
39 }
40
41 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698