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

Unified Diff: tools/cygprofile/cygprofile.cc

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> 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 | « tools/cygprofile/cygprofile.h ('k') | tools/cygprofile/cygprofile_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cygprofile/cygprofile.cc
diff --git a/tools/cygprofile/cygprofile.cc b/tools/cygprofile/cygprofile.cc
index 6b5182dec7ffc355124719557316a2510733e788..d699c3e355bd255250df242b449a4a9424bc8b67 100644
--- a/tools/cygprofile/cygprofile.cc
+++ b/tools/cygprofile/cygprofile.cc
@@ -24,6 +24,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
@@ -266,7 +267,7 @@ ThreadLogsManager::ThreadLogsManager(const base::Closure& wait_callback,
ThreadLogsManager::~ThreadLogsManager() {
// Note that the internal thread does some work until it sees |flush_thread_|
// = NULL.
- scoped_ptr<Thread> flush_thread;
+ std::unique_ptr<Thread> flush_thread;
{
base::AutoLock auto_lock(lock_);
flush_thread_.swap(flush_thread);
@@ -276,7 +277,7 @@ ThreadLogsManager::~ThreadLogsManager() {
STLDeleteContainerPointers(logs_.begin(), logs_.end());
}
-void ThreadLogsManager::AddLog(scoped_ptr<ThreadLog> new_log) {
+void ThreadLogsManager::AddLog(std::unique_ptr<ThreadLog> new_log) {
base::AutoLock auto_lock(lock_);
if (logs_.empty())
@@ -361,7 +362,7 @@ void __cyg_profile_func_enter(void* this_fn, void* callee_unused) {
g_tls_log = kMagicBeingConstructed;
ThreadLog* new_log = new ThreadLog();
CHECK(new_log);
- g_logs_manager.Pointer()->AddLog(make_scoped_ptr(new_log));
+ g_logs_manager.Pointer()->AddLog(base::WrapUnique(new_log));
g_tls_log = new_log;
}
« no previous file with comments | « tools/cygprofile/cygprofile.h ('k') | tools/cygprofile/cygprofile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698