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

Unified Diff: extensions/browser/api/declarative/rules_registry.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: extensions/browser/api/declarative/rules_registry.cc
diff --git a/extensions/browser/api/declarative/rules_registry.cc b/extensions/browser/api/declarative/rules_registry.cc
index fd77d4646ff67579f69a5158e7e89465fef7c725..718a8ef2c5fb9d325afa66bf0f8e45dee114a64b 100644
--- a/extensions/browser/api/declarative/rules_registry.cc
+++ b/extensions/browser/api/declarative/rules_registry.cc
@@ -42,7 +42,7 @@ std::unique_ptr<base::Value> RulesToValue(
const std::vector<linked_ptr<api::events::Rule>>& rules) {
std::unique_ptr<base::ListValue> list(new base::ListValue());
for (size_t i = 0; i < rules.size(); ++i)
- list->Append(rules[i]->ToValue().release());
+ list->Append(rules[i]->ToValue());
return std::move(list);
Nico 2016/06/09 16:57:35 huh, why doesn't clang issue a -Wpessimizing-move
dcheng 2016/06/09 17:09:46 C++11 still requires an explicit std::move() here,
}

Powered by Google App Engine
This is Rietveld 408576698