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

Unified Diff: chrome/browser/task_profiler/task_profiler_data_serializer.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
Index: chrome/browser/task_profiler/task_profiler_data_serializer.cc
diff --git a/chrome/browser/task_profiler/task_profiler_data_serializer.cc b/chrome/browser/task_profiler/task_profiler_data_serializer.cc
index c9f3b5e0f6ce6ba0aa3a583527f18307a2ce4150..9a6b733980a10e94bfdb51e39adbca91347c5bd5 100644
--- a/chrome/browser/task_profiler/task_profiler_data_serializer.cc
+++ b/chrome/browser/task_profiler/task_profiler_data_serializer.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/task_profiler/task_profiler_data_serializer.h"
#include <memory>
+#include <utility>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -126,7 +127,7 @@ void TaskProfilerDataSerializer::ToValue(
for (const auto& task : process_data_phase.tasks) {
std::unique_ptr<base::DictionaryValue> snapshot(new base::DictionaryValue);
TaskSnapshotToValue(task, snapshot.get());
- tasks_list->Append(snapshot.release());
+ tasks_list->Append(std::move(snapshot));
}
dictionary->Set("list", tasks_list.release());

Powered by Google App Engine
This is Rietveld 408576698