Index: components/rappor/rappor_service.cc |
diff --git a/components/rappor/rappor_service.cc b/components/rappor/rappor_service.cc |
index 02853afb34f2f1c8d2fc5b61a0c4db778df1a818..f8bbdd6e3bc83c07a55ceaaa7466c5a0ba7c2a22 100644 |
--- a/components/rappor/rappor_service.cc |
+++ b/components/rappor/rappor_service.cc |
@@ -6,6 +6,7 @@ |
#include <utility> |
+#include "base/memory/ptr_util.h" |
#include "base/metrics/field_trial.h" |
#include "base/metrics/metrics_hashes.h" |
#include "base/stl_util.h" |
@@ -68,7 +69,7 @@ RapporService::~RapporService() { |
} |
void RapporService::AddDailyObserver( |
- scoped_ptr<metrics::DailyEvent::Observer> observer) { |
+ std::unique_ptr<metrics::DailyEvent::Observer> observer) { |
daily_event_.AddObserver(std::move(observer)); |
} |
@@ -82,11 +83,9 @@ void RapporService::Initialize(net::URLRequestContextGetter* request_context) { |
return; |
} |
DVLOG(1) << "RapporService reporting to " << server_url.spec(); |
- InitializeInternal(make_scoped_ptr(new LogUploader(server_url, |
- kMimeType, |
- request_context)), |
- internal::LoadCohort(pref_service_), |
- internal::LoadSecret(pref_service_)); |
+ InitializeInternal( |
+ base::WrapUnique(new LogUploader(server_url, kMimeType, request_context)), |
+ internal::LoadCohort(pref_service_), internal::LoadSecret(pref_service_)); |
} |
void RapporService::Update(int recording_groups, bool may_upload) { |
@@ -124,7 +123,7 @@ void RapporService::RegisterPrefs(PrefRegistrySimple* registry) { |
} |
void RapporService::InitializeInternal( |
- scoped_ptr<LogUploaderInterface> uploader, |
+ std::unique_ptr<LogUploaderInterface> uploader, |
int32_t cohort, |
const std::string& secret) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
@@ -249,15 +248,15 @@ RapporMetric* RapporService::LookUpMetric(const std::string& metric_name, |
return new_metric; |
} |
-scoped_ptr<Sample> RapporService::CreateSample(RapporType type) { |
+std::unique_ptr<Sample> RapporService::CreateSample(RapporType type) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
DCHECK(IsInitialized()); |
- return scoped_ptr<Sample>( |
+ return base::WrapUnique( |
new Sample(cohort_, internal::kRapporParametersForType[type])); |
} |
void RapporService::RecordSampleObj(const std::string& metric_name, |
- scoped_ptr<Sample> sample) { |
+ std::unique_ptr<Sample> sample) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
if (!RecordingAllowed(sample->parameters())) |
return; |