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

Unified Diff: content/browser/tracing/background_tracing_rule.cc

Issue 1874893002: Convert //content/browser 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
Index: content/browser/tracing/background_tracing_rule.cc
diff --git a/content/browser/tracing/background_tracing_rule.cc b/content/browser/tracing/background_tracing_rule.cc
index f09608ab0b772cbe4e955eb0618e96192a33c1bd..cf11772572042eb9f3d4c688072076195d1e53e3 100644
--- a/content/browser/tracing/background_tracing_rule.cc
+++ b/content/browser/tracing/background_tracing_rule.cc
@@ -92,13 +92,13 @@ class NamedTriggerRule : public BackgroundTracingRule {
: named_event_(named_event) {}
public:
- static scoped_ptr<BackgroundTracingRule> Create(
+ static std::unique_ptr<BackgroundTracingRule> Create(
const base::DictionaryValue* dict) {
std::string trigger_name;
if (!dict->GetString(kConfigRuleTriggerNameKey, &trigger_name))
return nullptr;
- return scoped_ptr<BackgroundTracingRule>(
+ return std::unique_ptr<BackgroundTracingRule>(
new NamedTriggerRule(trigger_name));
}
@@ -132,7 +132,7 @@ class HistogramRule : public BackgroundTracingRule,
trigger_delay_(trigger_delay) {}
public:
- static scoped_ptr<BackgroundTracingRule> Create(
+ static std::unique_ptr<BackgroundTracingRule> Create(
const base::DictionaryValue* dict) {
std::string histogram_name;
if (!dict->GetString(kConfigRuleHistogramNameKey, &histogram_name))
@@ -161,7 +161,7 @@ class HistogramRule : public BackgroundTracingRule,
int trigger_delay = -1;
dict->GetInteger(kConfigRuleTriggerDelay, &trigger_delay);
- return scoped_ptr<BackgroundTracingRule>(
+ return std::unique_ptr<BackgroundTracingRule>(
new HistogramRule(histogram_name, histogram_lower_value,
histogram_upper_value, repeat, trigger_delay));
}
@@ -263,14 +263,14 @@ class ReactiveTraceForNSOrTriggerOrFullRule : public BackgroundTracingRule {
: named_event_(named_event), category_preset_(category_preset) {}
public:
- static scoped_ptr<BackgroundTracingRule> Create(
+ static std::unique_ptr<BackgroundTracingRule> Create(
const base::DictionaryValue* dict,
BackgroundTracingConfigImpl::CategoryPreset category_preset) {
std::string trigger_name;
if (!dict->GetString(kConfigRuleTriggerNameKey, &trigger_name))
return nullptr;
- return scoped_ptr<BackgroundTracingRule>(
+ return std::unique_ptr<BackgroundTracingRule>(
new ReactiveTraceForNSOrTriggerOrFullRule(trigger_name,
category_preset));
}
@@ -318,7 +318,7 @@ class ReactiveTraceAtRandomIntervalsRule : public BackgroundTracingRule {
}
public:
- static scoped_ptr<BackgroundTracingRule> Create(
+ static std::unique_ptr<BackgroundTracingRule> Create(
const base::DictionaryValue* dict,
BackgroundTracingConfigImpl::CategoryPreset category_preset) {
int timeout_min;
@@ -332,7 +332,7 @@ class ReactiveTraceAtRandomIntervalsRule : public BackgroundTracingRule {
if (timeout_min > timeout_max)
return nullptr;
- return scoped_ptr<BackgroundTracingRule>(
+ return std::unique_ptr<BackgroundTracingRule>(
new ReactiveTraceAtRandomIntervalsRule(category_preset, timeout_min,
timeout_max));
}
@@ -411,7 +411,8 @@ class ReactiveTraceAtRandomIntervalsRule : public BackgroundTracingRule {
} // namespace
-scoped_ptr<BackgroundTracingRule> BackgroundTracingRule::PreemptiveRuleFromDict(
+std::unique_ptr<BackgroundTracingRule>
+BackgroundTracingRule::PreemptiveRuleFromDict(
const base::DictionaryValue* dict) {
DCHECK(dict);
@@ -419,7 +420,7 @@ scoped_ptr<BackgroundTracingRule> BackgroundTracingRule::PreemptiveRuleFromDict(
if (!dict->GetString(kConfigRuleKey, &type))
return nullptr;
- scoped_ptr<BackgroundTracingRule> tracing_rule;
+ std::unique_ptr<BackgroundTracingRule> tracing_rule;
if (type == kPreemptiveConfigRuleMonitorNamed)
tracing_rule = NamedTriggerRule::Create(dict);
else if (type == kPreemptiveConfigRuleMonitorHistogram)
@@ -431,7 +432,8 @@ scoped_ptr<BackgroundTracingRule> BackgroundTracingRule::PreemptiveRuleFromDict(
return tracing_rule;
}
-scoped_ptr<BackgroundTracingRule> BackgroundTracingRule::ReactiveRuleFromDict(
+std::unique_ptr<BackgroundTracingRule>
+BackgroundTracingRule::ReactiveRuleFromDict(
const base::DictionaryValue* dict,
BackgroundTracingConfigImpl::CategoryPreset category_preset) {
DCHECK(dict);
@@ -440,7 +442,7 @@ scoped_ptr<BackgroundTracingRule> BackgroundTracingRule::ReactiveRuleFromDict(
if (!dict->GetString(kConfigRuleKey, &type))
return nullptr;
- scoped_ptr<BackgroundTracingRule> tracing_rule;
+ std::unique_ptr<BackgroundTracingRule> tracing_rule;
if (type == kReactiveConfigRuleTraceOnNavigationUntilTriggerOrFull) {
tracing_rule =
« no previous file with comments | « content/browser/tracing/background_tracing_rule.h ('k') | content/browser/tracing/etw_system_event_consumer_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698