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

Unified Diff: components/rappor/rappor_service.cc

Issue 1921923002: Convert //components/[o-t]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/rappor/rappor_service.h ('k') | components/rappor/rappor_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « components/rappor/rappor_service.h ('k') | components/rappor/rappor_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698