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

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

Issue 1870003002: Convert //chrome/browser/safe_browsing from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments Created 4 years, 8 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 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 "chrome/common/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 scoped_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 MinimumProfileConsent Incident::GetMinimumProfileConsent() const { 22 MinimumProfileConsent Incident::GetMinimumProfileConsent() const {
23 return MinimumProfileConsent::SAFE_BROWSING_ENABLED; 23 return MinimumProfileConsent::SAFE_BROWSING_ENABLED;
24 } 24 }
25 25
26 Incident::Incident() : payload_(new ClientIncidentReport_IncidentData) { 26 Incident::Incident() : payload_(new ClientIncidentReport_IncidentData) {
27 payload_->set_incident_time_msec(base::Time::Now().ToJavaTime()); 27 payload_->set_incident_time_msec(base::Time::Now().ToJavaTime());
28 } 28 }
29 29
30 ClientIncidentReport_IncidentData* Incident::payload() { 30 ClientIncidentReport_IncidentData* Incident::payload() {
31 DCHECK(payload_); 31 DCHECK(payload_);
32 return payload_.get(); 32 return payload_.get();
33 } 33 }
34 34
35 const ClientIncidentReport_IncidentData* Incident::payload() const { 35 const ClientIncidentReport_IncidentData* Incident::payload() const {
36 DCHECK(payload_); 36 DCHECK(payload_);
37 return payload_.get(); 37 return payload_.get();
38 } 38 }
39 39
40 } // namespace safe_browsing 40 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698