OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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/osx_binary_integrity_i
ncident.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/browser/safe_browsing/incident_reporting/incident_handler_util.
h" |
| 9 #include "chrome/common/safe_browsing/csd.pb.h" |
| 10 |
| 11 namespace safe_browsing { |
| 12 |
| 13 OSXBinaryIntegrityIncident::OSXBinaryIntegrityIncident( |
| 14 scoped_ptr<ClientIncidentReport_IncidentData_OSXBinaryIntegrityIncident> |
| 15 binary_integrity_incident) { |
| 16 DCHECK(binary_integrity_incident); |
| 17 DCHECK(binary_integrity_incident->has_file_basename()); |
| 18 payload()->set_allocated_osx_incident(binary_integrity_incident.release()); |
| 19 } |
| 20 |
| 21 OSXBinaryIntegrityIncident::~OSXBinaryIntegrityIncident() {} |
| 22 |
| 23 IncidentType OSXBinaryIntegrityIncident::GetType() const { |
| 24 return IncidentType::OSX_INCIDENT; |
| 25 } |
| 26 |
| 27 // Returns the basename of the binary. |
| 28 std::string OSXBinaryIntegrityIncident::GetKey() const { |
| 29 return payload()->osx_incident().file_basename(); |
| 30 } |
| 31 |
| 32 // Returns a digest computed over the payload. |
| 33 uint32_t OSXBinaryIntegrityIncident::ComputeDigest() const { |
| 34 return HashMessage(payload()->osx_incident()); |
| 35 } |
| 36 |
| 37 } // namespace safe_browsing |
OLD | NEW |