Use generic base::Value::SetKey
Remove base::Value::SetDoubleWithoutPathExpansion https://chromium-review.googlesource.com/591654 Remove base::Value::SetStringWithoutPathExpansion https://chromium-review.googlesource.com/592368 Remove base::Value::SetIntegerWithoutPathExpansion https://chromium-review.googlesource.com/591655
This commit is contained in:
parent
8250dbd172
commit
75c17cf846
4 changed files with 9 additions and 11 deletions
|
@ -87,18 +87,17 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
|||
|
||||
id value = [dict objectForKey:key];
|
||||
if ([value isKindOfClass:[NSString class]]) {
|
||||
result->SetStringWithoutPathExpansion(
|
||||
str_key, base::SysNSStringToUTF8(value));
|
||||
result->SetKey(str_key, base::Value(base::SysNSStringToUTF8(value)));
|
||||
} else if ([value isKindOfClass:[NSNumber class]]) {
|
||||
const char* objc_type = [value objCType];
|
||||
if (strcmp(objc_type, @encode(BOOL)) == 0 ||
|
||||
strcmp(objc_type, @encode(char)) == 0)
|
||||
result->SetBooleanWithoutPathExpansion(str_key, [value boolValue]);
|
||||
result->SetKey(str_key, base::Value([value boolValue]));
|
||||
else if (strcmp(objc_type, @encode(double)) == 0 ||
|
||||
strcmp(objc_type, @encode(float)) == 0)
|
||||
result->SetDoubleWithoutPathExpansion(str_key, [value doubleValue]);
|
||||
result->SetKey(str_key, base::Value([value doubleValue]));
|
||||
else
|
||||
result->SetIntegerWithoutPathExpansion(str_key, [value intValue]);
|
||||
result->SetKey(str_key, base::Value([value intValue]));
|
||||
} else if ([value isKindOfClass:[NSArray class]]) {
|
||||
std::unique_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
|
||||
if (sub_arr)
|
||||
|
@ -115,9 +114,8 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
|||
result->SetWithoutPathExpansion(str_key,
|
||||
base::MakeUnique<base::Value>());
|
||||
} else {
|
||||
result->SetStringWithoutPathExpansion(
|
||||
str_key,
|
||||
base::SysNSStringToUTF8([value description]));
|
||||
result->SetKey(str_key,
|
||||
base::Value(base::SysNSStringToUTF8([value description])));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ void ToDictionary(base::DictionaryValue* details,
|
|||
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
|
||||
net::HttpRequestHeaders::Iterator it(headers);
|
||||
while (it.GetNext())
|
||||
dict->SetStringWithoutPathExpansion(it.name(), it.value());
|
||||
dict->SetKey(it.name(), base::Value(it.value()));
|
||||
details->Set("requestHeaders", std::move(dict));
|
||||
}
|
||||
|
||||
|
|
|
@ -608,7 +608,7 @@ void InspectableWebContentsImpl::GetPreferences(
|
|||
void InspectableWebContentsImpl::SetPreference(const std::string& name,
|
||||
const std::string& value) {
|
||||
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
|
||||
update.Get()->SetStringWithoutPathExpansion(name, value);
|
||||
update.Get()->SetKey(name, base::Value(value));
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::RemovePreference(const std::string& name) {
|
||||
|
|
|
@ -95,7 +95,7 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
|
|||
if (modification_is_removal)
|
||||
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, nullptr);
|
||||
else
|
||||
host_zoom_dictionary->SetDoubleWithoutPathExpansion(change.host, level);
|
||||
host_zoom_dictionary->SetKey(change.host, base::Value(level));
|
||||
}
|
||||
|
||||
void ZoomLevelDelegate::ExtractPerHostZoomLevels(
|
||||
|
|
Loading…
Reference in a new issue