| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/incident.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/incident.h" | 
| 6 | 6 | 
| 7 #include <utility> | 7 #include <utility> | 
| 8 | 8 | 
| 9 #include "base/logging.h" | 9 #include "base/logging.h" | 
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" | 
| 11 #include "chrome/common/safe_browsing/csd.pb.h" | 11 #include "components/safe_browsing/csd.pb.h" | 
| 12 | 12 | 
| 13 namespace safe_browsing { | 13 namespace safe_browsing { | 
| 14 | 14 | 
| 15 Incident::~Incident() { | 15 Incident::~Incident() { | 
| 16 } | 16 } | 
| 17 | 17 | 
| 18 std::unique_ptr<ClientIncidentReport_IncidentData> Incident::TakePayload() { | 18 std::unique_ptr<ClientIncidentReport_IncidentData> Incident::TakePayload() { | 
| 19   return std::move(payload_); | 19   return std::move(payload_); | 
| 20 } | 20 } | 
| 21 | 21 | 
| 22 Incident::Incident() : payload_(new ClientIncidentReport_IncidentData) { | 22 Incident::Incident() : payload_(new ClientIncidentReport_IncidentData) { | 
| 23   payload_->set_incident_time_msec(base::Time::Now().ToJavaTime()); | 23   payload_->set_incident_time_msec(base::Time::Now().ToJavaTime()); | 
| 24 } | 24 } | 
| 25 | 25 | 
| 26 ClientIncidentReport_IncidentData* Incident::payload() { | 26 ClientIncidentReport_IncidentData* Incident::payload() { | 
| 27   DCHECK(payload_); | 27   DCHECK(payload_); | 
| 28   return payload_.get(); | 28   return payload_.get(); | 
| 29 } | 29 } | 
| 30 | 30 | 
| 31 const ClientIncidentReport_IncidentData* Incident::payload() const { | 31 const ClientIncidentReport_IncidentData* Incident::payload() const { | 
| 32   DCHECK(payload_); | 32   DCHECK(payload_); | 
| 33   return payload_.get(); | 33   return payload_.get(); | 
| 34 } | 34 } | 
| 35 | 35 | 
| 36 }  // namespace safe_browsing | 36 }  // namespace safe_browsing | 
| OLD | NEW | 
|---|