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

Unified Diff: chrome/browser/extensions/api/metrics_private/metrics_private_api.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header 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
Index: chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
diff --git a/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc b/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
index 141e926e543ef63658382cfcc32db41e7bf19463..4ba270d32d1a8e4a0eb77fb1a2689ac2fca532d8 100644
--- a/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
+++ b/chrome/browser/extensions/api/metrics_private/metrics_private_api.cc
@@ -56,7 +56,7 @@ bool MetricsPrivateGetFieldTrialFunction::RunSync() {
}
bool MetricsPrivateGetVariationParamsFunction::RunSync() {
- scoped_ptr<GetVariationParams::Params> params(
+ std::unique_ptr<GetVariationParams::Params> params(
GetVariationParams::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
@@ -69,7 +69,7 @@ bool MetricsPrivateGetVariationParamsFunction::RunSync() {
}
bool MetricsPrivateRecordUserActionFunction::RunSync() {
- scoped_ptr<RecordUserAction::Params> params(
+ std::unique_ptr<RecordUserAction::Params> params(
RecordUserAction::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
@@ -114,7 +114,8 @@ bool MetricsHistogramHelperFunction::RecordValue(
}
bool MetricsPrivateRecordValueFunction::RunSync() {
- scoped_ptr<RecordValue::Params> params(RecordValue::Params::Create(*args_));
+ std::unique_ptr<RecordValue::Params> params(
+ RecordValue::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
// Get the histogram parameters from the metric type object.
@@ -128,7 +129,7 @@ bool MetricsPrivateRecordValueFunction::RunSync() {
}
bool MetricsPrivateRecordSparseValueFunction::RunSync() {
- scoped_ptr<RecordSparseValue::Params> params(
+ std::unique_ptr<RecordSparseValue::Params> params(
RecordSparseValue::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
// This particular UMA_HISTOGRAM_ macro is okay for
@@ -138,7 +139,7 @@ bool MetricsPrivateRecordSparseValueFunction::RunSync() {
}
bool MetricsPrivateRecordPercentageFunction::RunSync() {
- scoped_ptr<RecordPercentage::Params> params(
+ std::unique_ptr<RecordPercentage::Params> params(
RecordPercentage::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
return RecordValue(params->metric_name, base::LINEAR_HISTOGRAM,
@@ -146,14 +147,15 @@ bool MetricsPrivateRecordPercentageFunction::RunSync() {
}
bool MetricsPrivateRecordCountFunction::RunSync() {
- scoped_ptr<RecordCount::Params> params(RecordCount::Params::Create(*args_));
+ std::unique_ptr<RecordCount::Params> params(
+ RecordCount::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
return RecordValue(params->metric_name, base::HISTOGRAM,
1, 1000000, 50, params->value);
}
bool MetricsPrivateRecordSmallCountFunction::RunSync() {
- scoped_ptr<RecordSmallCount::Params> params(
+ std::unique_ptr<RecordSmallCount::Params> params(
RecordSmallCount::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
return RecordValue(params->metric_name, base::HISTOGRAM,
@@ -161,7 +163,7 @@ bool MetricsPrivateRecordSmallCountFunction::RunSync() {
}
bool MetricsPrivateRecordMediumCountFunction::RunSync() {
- scoped_ptr<RecordMediumCount::Params> params(
+ std::unique_ptr<RecordMediumCount::Params> params(
RecordMediumCount::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
return RecordValue(params->metric_name, base::HISTOGRAM,
@@ -169,7 +171,8 @@ bool MetricsPrivateRecordMediumCountFunction::RunSync() {
}
bool MetricsPrivateRecordTimeFunction::RunSync() {
- scoped_ptr<RecordTime::Params> params(RecordTime::Params::Create(*args_));
+ std::unique_ptr<RecordTime::Params> params(
+ RecordTime::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
static const int kTenSecMs = 10 * 1000;
return RecordValue(params->metric_name, base::HISTOGRAM,
@@ -177,7 +180,7 @@ bool MetricsPrivateRecordTimeFunction::RunSync() {
}
bool MetricsPrivateRecordMediumTimeFunction::RunSync() {
- scoped_ptr<RecordMediumTime::Params> params(
+ std::unique_ptr<RecordMediumTime::Params> params(
RecordMediumTime::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
static const int kThreeMinMs = 3 * 60 * 1000;
@@ -186,7 +189,7 @@ bool MetricsPrivateRecordMediumTimeFunction::RunSync() {
}
bool MetricsPrivateRecordLongTimeFunction::RunSync() {
- scoped_ptr<RecordLongTime::Params> params(
+ std::unique_ptr<RecordLongTime::Params> params(
RecordLongTime::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
static const int kOneHourMs = 60 * 60 * 1000;

Powered by Google App Engine
This is Rietveld 408576698