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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc

Issue 856543004: Replace incident type handlers with implementations of Incident. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: robertshield comments Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc
index cb0c69450864883f8efbe24fbfb8600ca9fe7d54..769289271bf53d50b8ae0d58a201df6c3b8580ee 100644
--- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc
@@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/safe_browsing/binary_feature_extractor.h"
+#include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/safe_browsing/csd.pb.h"
@@ -69,17 +70,16 @@ void VerifyBinaryIntegrity(const AddIncidentCallback& callback) {
// Only create a report if the signature is untrusted.
if (!signature_info->trusted()) {
- scoped_ptr<ClientIncidentReport_IncidentData> incident_data(
- new ClientIncidentReport_IncidentData());
- ClientIncidentReport_IncidentData_BinaryIntegrityIncident*
- binary_integrity = incident_data->mutable_binary_integrity();
+ scoped_ptr<ClientIncidentReport_IncidentData_BinaryIntegrityIncident>
+ incident(
+ new ClientIncidentReport_IncidentData_BinaryIntegrityIncident());
- binary_integrity->set_file_basename(
- binary_path.BaseName().AsUTF8Unsafe());
- binary_integrity->set_allocated_signature(signature_info.release());
+ incident->set_file_basename(binary_path.BaseName().AsUTF8Unsafe());
+ incident->set_allocated_signature(signature_info.release());
// Send the report.
- callback.Run(incident_data.Pass());
+ callback.Run(make_scoped_ptr(
+ new BinaryIntegrityIncident(incident.Pass())));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698