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