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

Unified Diff: tools/cygprofile/cygprofile.cc

Issue 2459763003: Remove stl_util's deletion function use from tools/. (Closed)
Patch Set: fix Created 4 years, 2 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') | no next file » | 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 c4cb5ef45a2df855be676adfd1a8a8e7a3c75b7a..fe691963f4199ed812fb0d945dd6c99cfa61d006 100644
--- a/tools/cygprofile/cygprofile.cc
+++ b/tools/cygprofile/cygprofile.cc
@@ -296,8 +296,6 @@ ThreadLogsManager::~ThreadLogsManager() {
flush_thread_.swap(flush_thread);
}
flush_thread.reset(); // Joins the flush thread.
-
- base::STLDeleteContainerPointers(logs_.begin(), logs_.end());
}
void ThreadLogsManager::AddLog(std::unique_ptr<ThreadLog> new_log) {
@@ -306,7 +304,7 @@ void ThreadLogsManager::AddLog(std::unique_ptr<ThreadLog> new_log) {
if (logs_.empty())
StartInternalFlushThread_Locked();
- logs_.push_back(new_log.release());
+ logs_.push_back(std::move(new_log));
}
void ThreadLogsManager::StartInternalFlushThread_Locked() {
@@ -345,7 +343,8 @@ void ThreadLogsManager::FlushAllLogsOnFlushThread() {
std::vector<ThreadLog*> thread_logs_copy;
{
base::AutoLock auto_lock(lock_);
- thread_logs_copy = logs_;
+ for (const auto& log : logs_)
+ thread_logs_copy.push_back(log.get());
}
// Move the logs' data before flushing them so that the mutexes are not
« no previous file with comments | « tools/cygprofile/cygprofile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698