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

Unified Diff: base/trace_event/trace_config.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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 | « base/trace_event/trace_config.h ('k') | base/trace_event/trace_config_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_config.cc
diff --git a/base/trace_event/trace_config.cc b/base/trace_event/trace_config.cc
index c2c7ad792278ba34040f1c8d74720651e3d88309..e9e5a099893377e844be716845b0bbcfe90a2639 100644
--- a/base/trace_event/trace_config.cc
+++ b/base/trace_event/trace_config.cc
@@ -10,6 +10,7 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/pattern.h"
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
@@ -160,9 +161,9 @@ std::string TraceConfig::ToString() const {
return json;
}
-scoped_ptr<ConvertableToTraceFormat> TraceConfig::AsConvertableToTraceFormat()
- const {
- return make_scoped_ptr(new ConvertableTraceConfigToTraceFormat(*this));
+std::unique_ptr<ConvertableToTraceFormat>
+TraceConfig::AsConvertableToTraceFormat() const {
+ return WrapUnique(new ConvertableTraceConfigToTraceFormat(*this));
}
std::string TraceConfig::ToCategoryFilterString() const {
@@ -345,7 +346,7 @@ void TraceConfig::InitializeFromConfigDict(const DictionaryValue& dict) {
}
void TraceConfig::InitializeFromConfigString(const std::string& config_string) {
- scoped_ptr<Value> value(JSONReader::Read(config_string));
+ std::unique_ptr<Value> value(JSONReader::Read(config_string));
if (!value)
return InitializeDefault();
@@ -476,7 +477,7 @@ void TraceConfig::AddCategoryToDict(base::DictionaryValue& dict,
if (categories.empty())
return;
- scoped_ptr<base::ListValue> list(new base::ListValue());
+ std::unique_ptr<base::ListValue> list(new base::ListValue());
for (StringList::const_iterator ci = categories.begin();
ci != categories.end();
++ci) {
@@ -565,11 +566,11 @@ void TraceConfig::ToDict(base::DictionaryValue& dict) const {
AddCategoryToDict(dict, kSyntheticDelaysParam, synthetic_delays_);
if (IsCategoryEnabled(MemoryDumpManager::kTraceCategory)) {
- scoped_ptr<base::DictionaryValue> memory_dump_config(
+ std::unique_ptr<base::DictionaryValue> memory_dump_config(
new base::DictionaryValue());
- scoped_ptr<base::ListValue> triggers_list(new base::ListValue());
+ std::unique_ptr<base::ListValue> triggers_list(new base::ListValue());
for (const MemoryDumpTriggerConfig& config : memory_dump_config_) {
- scoped_ptr<base::DictionaryValue> trigger_dict(
+ std::unique_ptr<base::DictionaryValue> trigger_dict(
new base::DictionaryValue());
trigger_dict->SetInteger(kPeriodicIntervalParam,
static_cast<int>(config.periodic_interval_ms));
« no previous file with comments | « base/trace_event/trace_config.h ('k') | base/trace_event/trace_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698