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/domain_request_inciden
t.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 DomainRequestIncident::DomainRequestIncident( |
| 14 scoped_ptr<ClientIncidentReport_IncidentData_DomainRequestIncident> |
| 15 domain_request_incident) { |
| 16 DCHECK(domain_request_incident); |
| 17 DCHECK(domain_request_incident->has_domain_digest()); |
| 18 payload()->set_allocated_domain_request(domain_request_incident.release()); |
| 19 } |
| 20 |
| 21 DomainRequestIncident::~DomainRequestIncident() { |
| 22 } |
| 23 |
| 24 IncidentType DomainRequestIncident::GetType() const { |
| 25 return IncidentType::DOMAIN_REQUEST; |
| 26 } |
| 27 |
| 28 std::string DomainRequestIncident::GetKey() const { |
| 29 // Use a static key in addition to a fixed digest below to ensure that only |
| 30 // one incident per user is reported. |
| 31 return "domain_request_incident"; |
| 32 } |
| 33 |
| 34 uint32_t DomainRequestIncident::ComputeDigest() const { |
| 35 // Return a constant in addition to a fixed key above to ensure that only one |
| 36 // incident per user is reported. |
| 37 return 42; |
| 38 } |
| 39 |
| 40 } // namespace safe_browsing |
OLD | NEW |