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

Unified Diff: net/log/trace_net_log_observer.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu 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 | « net/log/test_net_log_entry.cc ('k') | net/log/trace_net_log_observer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/log/trace_net_log_observer.cc
diff --git a/net/log/trace_net_log_observer.cc b/net/log/trace_net_log_observer.cc
index 6fe44a8ea2e74753ba439033dd06f2d9b5ed4a2d..81d8d8aa0270aae41b3b4c5ae219c4c36c6bfa41 100644
--- a/net/log/trace_net_log_observer.cc
+++ b/net/log/trace_net_log_observer.cc
@@ -5,12 +5,13 @@
#include "net/log/trace_net_log_observer.h"
#include <stdio.h>
+
+#include <memory>
#include <string>
#include <utility>
#include "base/json/json_writer.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
#include "net/log/net_log.h"
@@ -24,7 +25,7 @@ const char kNetLogTracingCategory[] = "netlog";
class TracedValue : public base::trace_event::ConvertableToTraceFormat {
public:
- explicit TracedValue(scoped_ptr<base::Value> value)
+ explicit TracedValue(std::unique_ptr<base::Value> value)
: value_(std::move(value)) {}
private:
@@ -41,7 +42,7 @@ class TracedValue : public base::trace_event::ConvertableToTraceFormat {
}
private:
- scoped_ptr<base::Value> value_;
+ std::unique_ptr<base::Value> value_;
};
} // namespace
@@ -55,14 +56,14 @@ TraceNetLogObserver::~TraceNetLogObserver() {
}
void TraceNetLogObserver::OnAddEntry(const NetLog::Entry& entry) {
- scoped_ptr<base::Value> params(entry.ParametersToValue());
+ std::unique_ptr<base::Value> params(entry.ParametersToValue());
switch (entry.phase()) {
case NetLog::PHASE_BEGIN:
TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(
kNetLogTracingCategory, NetLog::EventTypeToString(entry.type()),
entry.source().id, "source_type",
NetLog::SourceTypeToString(entry.source().type), "params",
- scoped_ptr<base::trace_event::ConvertableToTraceFormat>(
+ std::unique_ptr<base::trace_event::ConvertableToTraceFormat>(
new TracedValue(std::move(params))));
break;
case NetLog::PHASE_END:
@@ -70,7 +71,7 @@ void TraceNetLogObserver::OnAddEntry(const NetLog::Entry& entry) {
kNetLogTracingCategory, NetLog::EventTypeToString(entry.type()),
entry.source().id, "source_type",
NetLog::SourceTypeToString(entry.source().type), "params",
- scoped_ptr<base::trace_event::ConvertableToTraceFormat>(
+ std::unique_ptr<base::trace_event::ConvertableToTraceFormat>(
new TracedValue(std::move(params))));
break;
case NetLog::PHASE_NONE:
@@ -78,7 +79,7 @@ void TraceNetLogObserver::OnAddEntry(const NetLog::Entry& entry) {
kNetLogTracingCategory, NetLog::EventTypeToString(entry.type()),
entry.source().id, "source_type",
NetLog::SourceTypeToString(entry.source().type), "params",
- scoped_ptr<base::trace_event::ConvertableToTraceFormat>(
+ std::unique_ptr<base::trace_event::ConvertableToTraceFormat>(
new TracedValue(std::move(params))));
break;
}
« no previous file with comments | « net/log/test_net_log_entry.cc ('k') | net/log/trace_net_log_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698