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

Unified Diff: chrome/browser/ui/tabs/pinned_tab_codec.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/tabs/pinned_tab_codec.cc
diff --git a/chrome/browser/ui/tabs/pinned_tab_codec.cc b/chrome/browser/ui/tabs/pinned_tab_codec.cc
index 7fd14663930dd11164d856ff30ae5d56a4fe4dbb..ef9bbfd4b4abbea9d5e4c979fd156eb89876e13d 100644
--- a/chrome/browser/ui/tabs/pinned_tab_codec.cc
+++ b/chrome/browser/ui/tabs/pinned_tab_codec.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/values.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -40,7 +42,7 @@ static bool HasPinnedTabs(Browser* browser) {
static void EncodeTab(const StartupTab& tab, base::ListValue* values) {
std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue);
value->SetString(kURL, tab.url.spec());
- values->Append(value.release());
+ values->Append(std::move(value));
}
// Adds a base::DictionaryValue to |values| representing the pinned tab at the
@@ -54,7 +56,7 @@ static void EncodePinnedTab(TabStripModel* model,
NavigationEntry* entry = web_contents->GetController().GetActiveEntry();
if (entry) {
value->SetString(kURL, entry->GetURL().spec());
- values->Append(value.release());
+ values->Append(std::move(value));
}
}

Powered by Google App Engine
This is Rietveld 408576698