0

CodeHealth: Remove use of Value::GetAsString.

This change removes the use of Value::GetAsString and replaces with
Value::is_string, Value::GetString(), Value::GetIfString().

This CL was uploaded by git cl split.

R=slangley@chromium.org

Bug: 1187007
Change-Id: Id7d97b79e5df4ee2aaa10da89d9544f1734c0b61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3098905
Auto-Submit: Sammie Quon <sammiequon@chromium.org>
Reviewed-by: Stuart Langley <slangley@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#912426}
This commit is contained in:
Sammie Quon
2021-08-17 01:23:42 +00:00
committed by Chromium LUCI CQ
parent f6f91eec0b
commit c654059782

@ -81,13 +81,13 @@ bool GetOpenWithLinksFromDictionaryValue(
result->reserve(dictionary_value->DictSize());
for (base::DictionaryValue::Iterator iter(*dictionary_value); !iter.IsAtEnd();
iter.Advance()) {
std::string string_value;
if (!iter.value().GetAsString(&string_value))
const std::string* string_value = iter.value().GetIfString();
if (!string_value)
return false;
FileResource::OpenWithLink open_with_link;
open_with_link.app_id = iter.key();
open_with_link.open_url = GURL(string_value);
open_with_link.open_url = GURL(*string_value);
result->push_back(open_with_link);
}