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

Unified Diff: chrome/browser/chromeos/file_manager/file_browser_handlers.cc

Issue 2765363004: Stop passing raw pointers to DictionaryValue::Set, part 2 (Closed)
Patch Set: Fix comments Created 3 years, 9 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/chromeos/file_manager/file_browser_handlers.cc
diff --git a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc
index 7ed9f3493f5a035322cf99df00941c27b96ddd7b..5c3da03c0e2cec2a550186a11911260c3788bcea 100644
--- a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc
+++ b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc
@@ -392,9 +392,7 @@ void FileBrowserHandlerExecutor::SetupPermissionsAndDispatchEvent(
auto details = base::MakeUnique<base::DictionaryValue>();
// Get file definitions. These will be replaced with Entry instances by
// dispatchEvent() method from event_binding.js.
- base::ListValue* file_entries = new base::ListValue();
- details->Set("entries", file_entries);
- event_args->Append(std::move(details));
+ auto file_entries = base::MakeUnique<base::ListValue>();
for (EntryDefinitionList::const_iterator iter =
entry_definition_list->begin();
@@ -409,6 +407,8 @@ void FileBrowserHandlerExecutor::SetupPermissionsAndDispatchEvent(
file_entries->Append(std::move(file_def));
}
+ details->Set("entries", std::move(file_entries));
+ event_args->Append(std::move(details));
std::unique_ptr<extensions::Event> event(new extensions::Event(
extensions::events::FILE_BROWSER_HANDLER_ON_EXECUTE,
"fileBrowserHandler.onExecute", std::move(event_args)));
« no previous file with comments | « chrome/browser/chromeos/extensions/info_private_api.cc ('k') | chrome/browser/chromeos/file_manager/url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698