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

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

Issue 2777063003: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Just rebased Created 3 years, 8 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_tasks.cc
diff --git a/chrome/browser/chromeos/file_manager/file_tasks.cc b/chrome/browser/chromeos/file_manager/file_tasks.cc
index b9642e771799bfeb3100158c76d7ffe1102f532e..b248317ac980d261182a8821330d752af72b05ff 100644
--- a/chrome/browser/chromeos/file_manager/file_tasks.cc
+++ b/chrome/browser/chromeos/file_manager/file_tasks.cc
@@ -11,6 +11,7 @@
#include "apps/launcher.h"
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
@@ -197,8 +198,8 @@ void UpdateDefaultTask(PrefService* pref_service,
prefs::kDefaultTasksByMimeType);
for (std::set<std::string>::const_iterator iter = mime_types.begin();
iter != mime_types.end(); ++iter) {
- base::Value* value = new base::Value(task_id);
- mime_type_pref->SetWithoutPathExpansion(*iter, value);
+ mime_type_pref->SetWithoutPathExpansion(
+ *iter, base::MakeUnique<base::Value>(task_id));
}
}
@@ -207,10 +208,10 @@ void UpdateDefaultTask(PrefService* pref_service,
prefs::kDefaultTasksBySuffix);
for (std::set<std::string>::const_iterator iter = suffixes.begin();
iter != suffixes.end(); ++iter) {
- base::Value* value = new base::Value(task_id);
// Suffixes are case insensitive.
std::string lower_suffix = base::ToLowerASCII(*iter);
- mime_type_pref->SetWithoutPathExpansion(lower_suffix, value);
+ mime_type_pref->SetWithoutPathExpansion(
+ lower_suffix, base::MakeUnique<base::Value>(task_id));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698