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

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

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Comment Updates 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/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 41aca8d675d178de5c471fb8df4a030129da7654..86c62269902c872e9e3fe52ed7ef6caa06f7b34c 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -671,8 +671,7 @@ std::vector<Profile*> ProfileManager::GetLastOpenedProfiles(
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;
@@ -894,10 +893,10 @@ void ProfileManager::CleanUpDeletedProfiles() {
local_state->GetList(prefs::kProfilesDeleted);
DCHECK(deleted_profiles);
- for (const std::unique_ptr<base::Value>& value : *deleted_profiles) {
+ for (const 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.
@@ -908,12 +907,11 @@ void ProfileManager::CleanUpDeletedProfiles() {
BrowserThread::PostTaskAndReply(
BrowserThread::FILE, FROM_HERE,
base::Bind(&NukeProfileFromDisk, profile_path),
- base::Bind(&ProfileCleanedUp, value.get()));
+ base::Bind(&ProfileCleanedUp, &value));
} else {
// Everything is fine, the profile was removed on shutdown.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&ProfileCleanedUp, value.get()));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&ProfileCleanedUp, &value));
}
} else {
LOG(ERROR) << "Found invalid profile path in deleted_profiles: "

Powered by Google App Engine
This is Rietveld 408576698