Commit bfc4044d authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Add CHECKS to debug GuestOsSharePath::GetPersistedSharedPaths crashes

Bug: 1057591
Change-Id: Ibae5f698d1c9b27ea72e006ff7b274ace7524578
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2114476
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Fergus Dall <sidereal@google.com>
Reviewed-by: default avatarFergus Dall <sidereal@google.com>
Cr-Commit-Position: refs/heads/master@{#752375}
parent cc2b5732
...@@ -455,9 +455,13 @@ bool GuestOsSharePath::GetAndSetFirstForSession() { ...@@ -455,9 +455,13 @@ bool GuestOsSharePath::GetAndSetFirstForSession() {
std::vector<base::FilePath> GuestOsSharePath::GetPersistedSharedPaths( std::vector<base::FilePath> GuestOsSharePath::GetPersistedSharedPaths(
const std::string& vm_name) { const std::string& vm_name) {
std::vector<base::FilePath> result; std::vector<base::FilePath> result;
// TODO(crbug.com/1057591): Unexpected crashes here.
CHECK(profile_);
CHECK(profile_->GetPrefs());
// |shared_paths| format is {'path': ['vm1', vm2']}. // |shared_paths| format is {'path': ['vm1', vm2']}.
const base::DictionaryValue* shared_paths = const base::DictionaryValue* shared_paths =
profile_->GetPrefs()->GetDictionary(prefs::kGuestOSPathsSharedToVms); profile_->GetPrefs()->GetDictionary(prefs::kGuestOSPathsSharedToVms);
CHECK(shared_paths);
for (const auto& it : shared_paths->DictItems()) { for (const auto& it : shared_paths->DictItems()) {
base::FilePath path(it.first); base::FilePath path(it.first);
for (const auto& vm : it.second.GetList()) { for (const auto& vm : it.second.GetList()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment