diff --git a/base/trace_event/trace_event_argument.cc b/base/trace_event/trace_event_argument.cc index 3c4fb301303d09..24002725d817ca 100644 --- a/base/trace_event/trace_event_argument.cc +++ b/base/trace_event/trace_event_argument.cc @@ -429,7 +429,7 @@ std::unique_ptr TracedValue::ToBaseValue() const { double value; CHECK(it.ReadDouble(&value)); if (cur_dict) { - cur_dict->SetDoubleWithoutPathExpansion(ReadKeyName(it), value); + cur_dict->SetKey(ReadKeyName(it), Value(value)); } else { cur_list->AppendDouble(value); } diff --git a/base/values.cc b/base/values.cc index 98e46f246c85f1..2bfa31c1f4601f 100644 --- a/base/values.cc +++ b/base/values.cc @@ -803,11 +803,6 @@ Value* DictionaryValue::SetWithoutPathExpansion( return ((*dict_)[key.as_string()] = std::move(in_value)).get(); } -Value* DictionaryValue::SetDoubleWithoutPathExpansion(StringPiece path, - double in_value) { - return SetWithoutPathExpansion(path, MakeUnique(in_value)); -} - Value* DictionaryValue::SetStringWithoutPathExpansion(StringPiece path, StringPiece in_value) { return SetWithoutPathExpansion(path, MakeUnique(in_value)); diff --git a/base/values.h b/base/values.h index 6a9aa795e21057..012fd655993be5 100644 --- a/base/values.h +++ b/base/values.h @@ -345,8 +345,6 @@ class BASE_EXPORT DictionaryValue : public Value { std::unique_ptr in_value); // Convenience forms of SetWithoutPathExpansion(). - // DEPRECATED, use Value::SetKey(path, Value(double)) instead. - Value* SetDoubleWithoutPathExpansion(StringPiece path, double in_value); // DEPRECATED, use Value::SetKey(path, Value(string)) instead. Value* SetStringWithoutPathExpansion(StringPiece path, StringPiece in_value); // DEPRECATED, use Value::SetKey(path, Value(string16)) instead. diff --git a/base/values_unittest.cc b/base/values_unittest.cc index bd7222217559ba..75f0ec424ace59 100644 --- a/base/values_unittest.cc +++ b/base/values_unittest.cc @@ -896,13 +896,6 @@ TEST(ValuesTest, DictionarySetReturnsPointer) { EXPECT_EQ(3.142, double_ptr->GetDouble()); } - { - DictionaryValue dict; - Value* double_ptr = dict.SetDoubleWithoutPathExpansion("foo.bar", 2.718); - EXPECT_EQ(Value::Type::DOUBLE, double_ptr->type()); - EXPECT_EQ(2.718, double_ptr->GetDouble()); - } - { DictionaryValue dict; Value* string_ptr = dict.SetString("foo.bar", "foo"); diff --git a/chrome/browser/ui/zoom/chrome_zoom_level_prefs.cc b/chrome/browser/ui/zoom/chrome_zoom_level_prefs.cc index cde991f9060b06..f487e524dfb4a7 100644 --- a/chrome/browser/ui/zoom/chrome_zoom_level_prefs.cc +++ b/chrome/browser/ui/zoom/chrome_zoom_level_prefs.cc @@ -124,8 +124,7 @@ void ChromeZoomLevelPrefs::OnZoomLevelChanged( if (modification_is_removal) { host_zoom_dictionary_weak->RemoveWithoutPathExpansion(change.host, nullptr); } else { - host_zoom_dictionary_weak->SetDoubleWithoutPathExpansion(change.host, - level); + host_zoom_dictionary_weak->SetKey(change.host, base::Value(level)); } } diff --git a/dbus/values_util_unittest.cc b/dbus/values_util_unittest.cc index 573ba561b95a48..1ee2b69b764324 100644 --- a/dbus/values_util_unittest.cc +++ b/dbus/values_util_unittest.cc @@ -341,7 +341,7 @@ TEST(ValuesUtilTest, PopDictionaryWithDottedStringKey) { base::DictionaryValue dictionary_value; dictionary_value.SetKey(kKey1, base::Value(kBoolValue)); dictionary_value.SetKey(kKey2, base::Value(kInt32Value)); - dictionary_value.SetDoubleWithoutPathExpansion(kKey3, kDoubleValue); + dictionary_value.SetKey(kKey3, base::Value(kDoubleValue)); // Pop a dictinoary. MessageReader reader(response.get()); diff --git a/ipc/ipc_message_utils_unittest.cc b/ipc/ipc_message_utils_unittest.cc index 38a7797bfd2fc2..24030c33f3e48e 100644 --- a/ipc/ipc_message_utils_unittest.cc +++ b/ipc/ipc_message_utils_unittest.cc @@ -100,7 +100,7 @@ TEST(IPCMessageUtilsTest, StackVector) { TEST(IPCMessageUtilsTest, ValueSize) { std::unique_ptr value(new base::DictionaryValue); value->SetKey("foo", base::Value(42)); - value->SetDoubleWithoutPathExpansion("bar", 3.14); + value->SetKey("bar", base::Value(3.14)); value->SetStringWithoutPathExpansion("baz", "hello"); value->SetWithoutPathExpansion("qux", base::MakeUnique()); diff --git a/media/base/video_frame_metadata.cc b/media/base/video_frame_metadata.cc index 68f0c635abec53..5c0cc7f17d3b7e 100644 --- a/media/base/video_frame_metadata.cc +++ b/media/base/video_frame_metadata.cc @@ -39,7 +39,7 @@ void VideoFrameMetadata::SetInteger(Key key, int value) { } void VideoFrameMetadata::SetDouble(Key key, double value) { - dictionary_.SetDoubleWithoutPathExpansion(ToInternalKey(key), value); + dictionary_.SetKey(ToInternalKey(key), base::Value(value)); } void VideoFrameMetadata::SetRotation(Key key, VideoRotation value) { diff --git a/services/preferences/pref_service_factory_unittest.cc b/services/preferences/pref_service_factory_unittest.cc index 516688cf7e445e..f15df07adefc9c 100644 --- a/services/preferences/pref_service_factory_unittest.cc +++ b/services/preferences/pref_service_factory_unittest.cc @@ -406,7 +406,7 @@ TEST_F(PrefServiceFactoryTest, MultipleClients_SubPrefUpdates_Basic) { EXPECT_EQ(3, out); }, [](ScopedDictionaryPrefUpdate* update) { - (*update)->SetDoubleWithoutPathExpansion("key.for.double", 4); + (*update)->SetKey("key.for.double", base::Value(4.0)); double out = 0; ASSERT_TRUE( (*update)->GetDoubleWithoutPathExpansion("key.for.double", &out)); diff --git a/services/preferences/public/cpp/dictionary_value_update.cc b/services/preferences/public/cpp/dictionary_value_update.cc index 0d509dcb1e7534..1174001ef074e6 100644 --- a/services/preferences/public/cpp/dictionary_value_update.cc +++ b/services/preferences/public/cpp/dictionary_value_update.cc @@ -107,12 +107,6 @@ void DictionaryValueUpdate::SetWithoutPathExpansion( value_->SetWithoutPathExpansion(key, std::move(in_value)); } -void DictionaryValueUpdate::SetDoubleWithoutPathExpansion( - base::StringPiece path, - double in_value) { - SetWithoutPathExpansion(path, base::MakeUnique(in_value)); -} - void DictionaryValueUpdate::SetStringWithoutPathExpansion( base::StringPiece path, base::StringPiece in_value) { diff --git a/services/preferences/public/cpp/dictionary_value_update.h b/services/preferences/public/cpp/dictionary_value_update.h index 918c915daff889..322921c3dd1fad 100644 --- a/services/preferences/public/cpp/dictionary_value_update.h +++ b/services/preferences/public/cpp/dictionary_value_update.h @@ -71,7 +71,6 @@ class DictionaryValueUpdate { std::unique_ptr in_value); // Convenience forms of SetWithoutPathExpansion(). - void SetDoubleWithoutPathExpansion(base::StringPiece path, double in_value); void SetStringWithoutPathExpansion(base::StringPiece path, base::StringPiece in_value); void SetStringWithoutPathExpansion(base::StringPiece path, diff --git a/services/preferences/public/cpp/tests/persistent_pref_store_client_unittest.cc b/services/preferences/public/cpp/tests/persistent_pref_store_client_unittest.cc index 701ba83844b550..f9444b7443f726 100644 --- a/services/preferences/public/cpp/tests/persistent_pref_store_client_unittest.cc +++ b/services/preferences/public/cpp/tests/persistent_pref_store_client_unittest.cc @@ -185,7 +185,7 @@ TEST_F(PersistentPrefStoreClientTest, TEST_F(PersistentPrefStoreClientTest, SubPrefUpdates_MultipleUpdates) { { ScopedDictionaryPrefUpdate update(pref_service(), kDictionaryKey); - update->SetDoubleWithoutPathExpansion("a.double", 1); + update->SetKey("a.double", base::Value(1.0)); } { ScopedDictionaryPrefUpdate update(pref_service(), kDictionaryKey); diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc index eac1977544acf2..f0b3bc07b22818 100644 --- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc +++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc @@ -602,7 +602,7 @@ struct FuzzTraits { case base::Value::Type::DOUBLE: { double tmp; fuzzer->FuzzDouble(&tmp); - p->SetDoubleWithoutPathExpansion(property, tmp); + p->SetKey(property, base::Value(tmp)); break; } case base::Value::Type::STRING: { diff --git a/tools/json_schema_compiler/test/simple_api_unittest.cc b/tools/json_schema_compiler/test/simple_api_unittest.cc index 14d9d166e79c8a..0b089182802ca4 100644 --- a/tools/json_schema_compiler/test/simple_api_unittest.cc +++ b/tools/json_schema_compiler/test/simple_api_unittest.cc @@ -14,7 +14,7 @@ namespace { static std::unique_ptr CreateTestTypeDictionary() { std::unique_ptr value(new base::DictionaryValue()); - value->SetDoubleWithoutPathExpansion("number", 1.1); + value->SetKey("number", base::Value(1.1)); value->SetKey("integer", base::Value(4)); value->SetStringWithoutPathExpansion("string", "bling"); value->SetKey("boolean", base::Value(true));