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: " |