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

Unified Diff: chrome/browser/ui/webui/foreign_session_handler.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/ui/webui/foreign_session_handler.cc
diff --git a/chrome/browser/ui/webui/foreign_session_handler.cc b/chrome/browser/ui/webui/foreign_session_handler.cc
index 2fc93f48c6a9fc268973f9e1517f125b00b1016f..e33b4e05ea466a5110f6acceb3f6dec8d097994e 100644
--- a/chrome/browser/ui/webui/foreign_session_handler.cc
+++ b/chrome/browser/ui/webui/foreign_session_handler.cc
@@ -8,6 +8,7 @@
#include <algorithm>
#include <string>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -111,7 +112,7 @@ std::unique_ptr<base::DictionaryValue> SessionWindowToValue(
if (tab_value.get()) {
modification_time = std::max(modification_time,
tab->timestamp);
- tab_values->Append(tab_value.release());
+ tab_values->Append(std::move(tab_value));
}
}
if (tab_values->GetSize() == 0)
@@ -305,7 +306,7 @@ void ForeignSessionHandler::HandleGetForeignSessions(
std::unique_ptr<base::DictionaryValue> window_data(
SessionWindowToValue(*map_iter.second));
if (window_data.get())
- window_list->Append(window_data.release());
+ window_list->Append(std::move(window_data));
}
} else {
// Order tabs by recency. This involves creating a synthetic singleton
@@ -319,19 +320,19 @@ void ForeignSessionHandler::HandleGetForeignSessions(
SessionTabToValue(*tab));
if (tab_value.get()) {
modification_time = std::max(modification_time, tab->timestamp);
- tab_values->Append(tab_value.release());
+ tab_values->Append(std::move(tab_value));
}
}
if (tab_values->GetSize() != 0) {
std::unique_ptr<base::DictionaryValue> window_data(
BuildWindowData(modification_time, 1));
window_data->Set("tabs", tab_values.release());
- window_list->Append(window_data.release());
+ window_list->Append(std::move(window_data));
}
}
session_data->Set("windows", window_list.release());
- session_list.Append(session_data.release());
+ session_list.Append(std::move(session_data));
}
}
base::FundamentalValue tab_sync_enabled(IsTabSyncEnabled());

Powered by Google App Engine
This is Rietveld 408576698