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

Unified Diff: chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique Created 4 years, 2 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/api/log_private/log_private_api_chromeos.cc
diff --git a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
index a3ee129773327fc5dded4b90171f348e2f5f8320..32061a877f910815917e165fc89688074d96bacb 100644
--- a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
+++ b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
@@ -14,6 +14,7 @@
#include "base/json/json_writer.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_prefs.h"
@@ -536,13 +537,13 @@ void LogPrivateDumpLogsFunction::OnStoreLogsCompleted(
log_path,
false);
- base::DictionaryValue* entry = new base::DictionaryValue();
+ auto entry = base::MakeUnique<base::DictionaryValue>();
entry->SetString("fileSystemId", file_entry.filesystem_id);
entry->SetString("baseName", file_entry.registered_name);
entry->SetString("id", file_entry.id);
entry->SetBoolean("isDirectory", false);
base::ListValue* entry_list = new base::ListValue();
- entry_list->Append(entry);
+ entry_list->Append(std::move(entry));
response->Set("entries", entry_list);
response->SetBoolean("multiple", false);
SetResult(std::move(response));

Powered by Google App Engine
This is Rietveld 408576698