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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: 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/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 26308bfd7f1d138b38999a6ba4c121b8c1d5f7c1..93f1a8b9d34194814f40077227bd94e15821bef9 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -680,7 +680,8 @@
base::ListValue::const_iterator it;
for (it = profile_list->begin(); it != profile_list->end(); ++it) {
std::string profile_path;
- if (!it->GetAsString(&profile_path) || profile_path.empty() ||
+ if (!(*it)->GetAsString(&profile_path) ||
+ profile_path.empty() ||
profile_path ==
base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) {
LOG(WARNING) << "Invalid entry in " << prefs::kProfilesLastActive;
@@ -902,10 +903,10 @@
local_state->GetList(prefs::kProfilesDeleted);
DCHECK(deleted_profiles);
- for (const base::Value& value : *deleted_profiles) {
+ for (const std::unique_ptr<base::Value>& value : *deleted_profiles) {
base::FilePath profile_path;
bool is_valid_profile_path =
- base::GetValueAsFilePath(value, &profile_path) &&
+ base::GetValueAsFilePath(*value, &profile_path) &&
profile_path.DirName() == user_data_dir();
// Although it should never happen, make sure this is a valid path in the
// user_data_dir, so we don't accidentially delete something else.
@@ -916,11 +917,12 @@
BrowserThread::PostTaskAndReply(
BrowserThread::FILE, FROM_HERE,
base::Bind(&NukeProfileFromDisk, profile_path),
- base::Bind(&ProfileCleanedUp, &value));
+ base::Bind(&ProfileCleanedUp, value.get()));
} else {
// Everything is fine, the profile was removed on shutdown.
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(&ProfileCleanedUp, &value));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&ProfileCleanedUp, value.get()));
}
} else {
LOG(ERROR) << "Found invalid profile path in deleted_profiles: "
« no previous file with comments | « chrome/browser/profile_resetter/profile_resetter_unittest.cc ('k') | chrome/browser/spellchecker/spellcheck_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698