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

Unified Diff: base/trace_event/trace_log.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_log.h ('k') | base/trace_event/winheap_dump_provider_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_log.cc
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc
index 1da4a63779c7664f22b08f365051113ff94cc4e0..a0b12fbc5426fc1f357b4be8eb219a690ca2c647 100644
--- a/base/trace_event/trace_log.cc
+++ b/base/trace_event/trace_log.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <cmath>
+#include <memory>
#include <utility>
#include "base/base_switches.h"
@@ -16,7 +17,6 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/process/process_metrics.h"
#include "base/stl_util.h"
@@ -241,7 +241,7 @@ class TraceLog::ThreadLocalEventBuffer
// Since TraceLog is a leaky singleton, trace_log_ will always be valid
// as long as the thread exists.
TraceLog* trace_log_;
- scoped_ptr<TraceBufferChunk> chunk_;
+ std::unique_ptr<TraceBufferChunk> chunk_;
size_t chunk_index_;
int generation_;
@@ -901,7 +901,7 @@ void TraceLog::FlushInternal(const TraceLog::OutputCallback& cb,
// Usually it runs on a different thread.
void TraceLog::ConvertTraceEventsToTraceFormat(
- scoped_ptr<TraceBuffer> logged_events,
+ std::unique_ptr<TraceBuffer> logged_events,
const OutputCallback& flush_output_callback,
const ArgumentFilterPredicate& argument_filter_predicate) {
if (flush_output_callback.is_null())
@@ -927,7 +927,7 @@ void TraceLog::ConvertTraceEventsToTraceFormat(
}
void TraceLog::FinishFlush(int generation, bool discard_events) {
- scoped_ptr<TraceBuffer> previous_logged_events;
+ std::unique_ptr<TraceBuffer> previous_logged_events;
OutputCallback flush_output_callback;
ArgumentFilterPredicate argument_filter_predicate;
@@ -1035,7 +1035,7 @@ TraceEventHandle TraceLog::AddTraceEvent(
const char** arg_names,
const unsigned char* arg_types,
const unsigned long long* arg_values,
- scoped_ptr<ConvertableToTraceFormat>* convertable_values,
+ std::unique_ptr<ConvertableToTraceFormat>* convertable_values,
unsigned int flags) {
int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
base::TimeTicks now = base::TimeTicks::Now();
@@ -1067,7 +1067,7 @@ TraceEventHandle TraceLog::AddTraceEventWithBindId(
const char** arg_names,
const unsigned char* arg_types,
const unsigned long long* arg_values,
- scoped_ptr<ConvertableToTraceFormat>* convertable_values,
+ std::unique_ptr<ConvertableToTraceFormat>* convertable_values,
unsigned int flags) {
int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
base::TimeTicks now = base::TimeTicks::Now();
@@ -1099,7 +1099,7 @@ TraceEventHandle TraceLog::AddTraceEventWithProcessId(
const char** arg_names,
const unsigned char* arg_types,
const unsigned long long* arg_values,
- scoped_ptr<ConvertableToTraceFormat>* convertable_values,
+ std::unique_ptr<ConvertableToTraceFormat>* convertable_values,
unsigned int flags) {
base::TimeTicks now = base::TimeTicks::Now();
return AddTraceEventWithThreadIdAndTimestamp(
@@ -1133,7 +1133,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp(
const char** arg_names,
const unsigned char* arg_types,
const unsigned long long* arg_values,
- scoped_ptr<ConvertableToTraceFormat>* convertable_values,
+ std::unique_ptr<ConvertableToTraceFormat>* convertable_values,
unsigned int flags) {
return AddTraceEventWithThreadIdAndTimestamp(
phase,
@@ -1165,7 +1165,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp(
const char** arg_names,
const unsigned char* arg_types,
const unsigned long long* arg_values,
- scoped_ptr<ConvertableToTraceFormat>* convertable_values,
+ std::unique_ptr<ConvertableToTraceFormat>* convertable_values,
unsigned int flags) {
TraceEventHandle handle = {0, 0, 0};
if (!*category_group_enabled)
@@ -1339,9 +1339,9 @@ void TraceLog::AddMetadataEvent(
const char** arg_names,
const unsigned char* arg_types,
const unsigned long long* arg_values,
- scoped_ptr<ConvertableToTraceFormat>* convertable_values,
+ std::unique_ptr<ConvertableToTraceFormat>* convertable_values,
unsigned int flags) {
- scoped_ptr<TraceEvent> trace_event(new TraceEvent);
+ std::unique_ptr<TraceEvent> trace_event(new TraceEvent);
int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
ThreadTicks thread_now = ThreadNow();
TimeTicks now = OffsetNow();
« no previous file with comments | « base/trace_event/trace_log.h ('k') | base/trace_event/winheap_dump_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698