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

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

Issue 2733343002: Move chrome/common/safe_browsing/csd.proto to components/safe_browsing (Closed)
Patch Set: rebase again Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/suspicious_module_inci dent.h" 5 #include "chrome/browser/safe_browsing/incident_reporting/suspicious_module_inci dent.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/safe_browsing/incident_reporting/incident_handler_util. h" 8 #include "chrome/browser/safe_browsing/incident_reporting/incident_handler_util. h"
9 #include "chrome/common/safe_browsing/csd.pb.h" 9 #include "components/safe_browsing/csd.pb.h"
10 10
11 namespace safe_browsing { 11 namespace safe_browsing {
12 12
13 SuspiciousModuleIncident::SuspiciousModuleIncident( 13 SuspiciousModuleIncident::SuspiciousModuleIncident(
14 std::unique_ptr<ClientIncidentReport_IncidentData_SuspiciousModuleIncident> 14 std::unique_ptr<ClientIncidentReport_IncidentData_SuspiciousModuleIncident>
15 suspicious_module_incident) { 15 suspicious_module_incident) {
16 DCHECK(suspicious_module_incident); 16 DCHECK(suspicious_module_incident);
17 DCHECK(suspicious_module_incident->has_path()); 17 DCHECK(suspicious_module_incident->has_path());
18 payload()->set_allocated_suspicious_module( 18 payload()->set_allocated_suspicious_module(
19 suspicious_module_incident.release()); 19 suspicious_module_incident.release());
20 } 20 }
21 21
22 SuspiciousModuleIncident::~SuspiciousModuleIncident() {} 22 SuspiciousModuleIncident::~SuspiciousModuleIncident() {}
23 23
24 IncidentType SuspiciousModuleIncident::GetType() const { 24 IncidentType SuspiciousModuleIncident::GetType() const {
25 return IncidentType::SUSPICIOUS_MODULE; 25 return IncidentType::SUSPICIOUS_MODULE;
26 } 26 }
27 27
28 // Returns the sanitized path of the module. 28 // Returns the sanitized path of the module.
29 std::string SuspiciousModuleIncident::GetKey() const { 29 std::string SuspiciousModuleIncident::GetKey() const {
30 return payload()->suspicious_module().path(); 30 return payload()->suspicious_module().path();
31 } 31 }
32 32
33 // Returns a digest computed over the payload. 33 // Returns a digest computed over the payload.
34 uint32_t SuspiciousModuleIncident::ComputeDigest() const { 34 uint32_t SuspiciousModuleIncident::ComputeDigest() const {
35 return HashMessage(payload()->suspicious_module()); 35 return HashMessage(payload()->suspicious_module());
36 } 36 }
37 37
38 } // namespace safe_browsing 38 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698