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

Unified Diff: chrome/browser/extensions/menu_manager.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/extensions/menu_manager.cc
diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc
index dfbd8a5030622ed5f8228f01a6d94412b947e579..dc9913d0b36726ea1cabd3f760d5174394b7e51d 100644
--- a/chrome/browser/extensions/menu_manager.cc
+++ b/chrome/browser/extensions/menu_manager.cc
@@ -92,7 +92,7 @@ MenuItem::List MenuItemsFromValue(const std::string& extension_id,
std::unique_ptr<base::Value> MenuItemsToValue(const MenuItem::List& items) {
std::unique_ptr<base::ListValue> list(new base::ListValue());
for (size_t i = 0; i < items.size(); ++i)
- list->Append(items[i]->ToValue().release());
+ list->Append(items[i]->ToValue());
return std::unique_ptr<base::Value>(list.release());
}
@@ -685,8 +685,7 @@ void MenuManager::ExecuteCommand(content::BrowserContext* context,
if (frame_id != ExtensionApiFrameIdMap::kInvalidFrameId)
properties->SetInteger("frameId", frame_id);
- args->Append(
- ExtensionTabUtil::CreateTabObject(web_contents)->ToValue().release());
+ args->Append(ExtensionTabUtil::CreateTabObject(web_contents)->ToValue());
} else {
args->Append(new base::DictionaryValue());
}

Powered by Google App Engine
This is Rietveld 408576698