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

Unified Diff: base/test/trace_event_analyzer.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/test/trace_event_analyzer.h ('k') | base/test/trace_event_analyzer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/trace_event_analyzer.cc
diff --git a/base/test/trace_event_analyzer.cc b/base/test/trace_event_analyzer.cc
index 18bfe38f9867cdf9743c4959f95a39e39047d79a..64436dc1444bfd6e5db0a4c8762ea3392b1b6fbd 100644
--- a/base/test/trace_event_analyzer.cc
+++ b/base/test/trace_event_analyzer.cc
@@ -7,10 +7,10 @@
#include <math.h>
#include <algorithm>
+#include <memory>
#include <set>
#include "base/json/json_reader.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/pattern.h"
#include "base/values.h"
@@ -144,7 +144,7 @@ bool TraceEvent::GetArgAsNumber(const std::string& name,
}
bool TraceEvent::GetArgAsValue(const std::string& name,
- scoped_ptr<base::Value>* arg) const {
+ std::unique_ptr<base::Value>* arg) const {
const auto it = arg_values.find(name);
if (it != arg_values.end()) {
*arg = it->second->CreateDeepCopy();
@@ -193,9 +193,9 @@ bool TraceEvent::GetKnownArgAsBool(const std::string& name) const {
return (arg_double != 0.0);
}
-scoped_ptr<base::Value> TraceEvent::GetKnownArgAsValue(
+std::unique_ptr<base::Value> TraceEvent::GetKnownArgAsValue(
const std::string& name) const {
- scoped_ptr<base::Value> arg_value;
+ std::unique_ptr<base::Value> arg_value;
bool result = GetArgAsValue(name, &arg_value);
DCHECK(result);
return arg_value;
@@ -679,7 +679,7 @@ size_t FindMatchingEvents(const std::vector<TraceEvent>& events,
bool ParseEventsFromJson(const std::string& json,
std::vector<TraceEvent>* output) {
- scoped_ptr<base::Value> root = base::JSONReader::Read(json);
+ std::unique_ptr<base::Value> root = base::JSONReader::Read(json);
base::ListValue* root_list = NULL;
if (!root.get() || !root->GetAsList(&root_list))
@@ -712,7 +712,7 @@ TraceAnalyzer::~TraceAnalyzer() {
// static
TraceAnalyzer* TraceAnalyzer::Create(const std::string& json_events) {
- scoped_ptr<TraceAnalyzer> analyzer(new TraceAnalyzer());
+ std::unique_ptr<TraceAnalyzer> analyzer(new TraceAnalyzer());
if (analyzer->SetEvents(json_events))
return analyzer.release();
return NULL;
« no previous file with comments | « base/test/trace_event_analyzer.h ('k') | base/test/trace_event_analyzer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698