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

Unified Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 2336863003: Change more base::ListValue methods to use std::unique_ptr. (Closed)
Patch Set: . Created 4 years, 3 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/extension_web_ui.cc
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index 06dae536319e928b0756de4657c4c339b9638456..024282ec85ba4d3bfad8881a86543d9e9cd08b31 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -7,9 +7,11 @@
#include <stddef.h>
#include <set>
+#include <utility>
#include <vector>
#include "base/command_line.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -109,11 +111,11 @@ void AddOverridesToList(base::ListValue* list,
}
}
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetString(kEntry, override);
dict->SetBoolean(kActive, true);
// Add the entry to the front of the list.
- list->Insert(0, dict.release());
+ list->Insert(0, std::move(dict));
}
// Validates that each entry in |list| contains a valid url and points to an
« no previous file with comments | « chrome/browser/extensions/extension_management_test_util.cc ('k') | chrome/browser/notifications/notifier_state_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698