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

Unified Diff: chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes Created 4 years, 7 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/common/extensions/api/file_browser_handlers/file_browser_handler.cc
diff --git a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
index 374a07631e061d4ab0d58053590686eafbc13bbf..d41a9ee4c721c2217319cb10a5712b078403716f 100644
--- a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
+++ b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc
@@ -253,15 +253,14 @@ bool LoadFileBrowserHandlers(
const base::ListValue* extension_actions,
FileBrowserHandler::List* result,
base::string16* error) {
- for (base::ListValue::const_iterator iter = extension_actions->begin();
- iter != extension_actions->end();
- ++iter) {
- if (!(*iter)->IsType(base::Value::TYPE_DICTIONARY)) {
+ for (const auto& entry : *extension_actions) {
+ base::DictionaryValue* dict;
+ if (!entry->GetAsDictionary(&dict)) {
*error = base::ASCIIToUTF16(errors::kInvalidFileBrowserHandler);
return false;
}
- std::unique_ptr<FileBrowserHandler> action(LoadFileBrowserHandler(
- extension_id, reinterpret_cast<base::DictionaryValue*>(*iter), error));
+ std::unique_ptr<FileBrowserHandler> action(
+ LoadFileBrowserHandler(extension_id, dict, error));
if (!action.get())
return false; // Failed to parse file browser action definition.
result->push_back(linked_ptr<FileBrowserHandler>(action.release()));
« no previous file with comments | « chrome/browser/ui/webui/site_settings_helper.cc ('k') | chrome/common/extensions/manifest_handlers/linked_app_icons.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698