0

Remove base::Value::Type::DICTIONARY

It is deprecated in favor of base::Value::Type::DICT, so change uses
of it to the new name and remove the enum value.

Fixed: 1291670
Change-Id: I26136fcb723e7dff1f5ffe3990d7011b18c16a43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4198081
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1098238}
This commit is contained in:
Avi Drissman
2023-01-28 02:31:26 +00:00
committed by Chromium LUCI CQ
parent 01ea4ce197
commit d2a736f985
398 changed files with 996 additions and 1013 deletions
android_webview
ash
base
cc/benchmarks
chrome
browser
apps
ash
browsing_data
cart
content_settings
devtools
engagement
enterprise
extensions
file_system_access
hid
media
metrics
net
page_load_metrics
performance_manager
policy
profiles
safe_browsing
search
sharing
speech
ssl
subresource_filter
upgrade_detector
usb
web_applications
common
credential_provider
renderer
test
chromecast
chromeos
ash
components
dbus
network
phonehub
proximity_auth
sync_wifi
services
components
printing
components
app_restore
bookmarks
cast_streaming
certificate_transparency
chromeos_camera
commerce
content_capture
content_settings
desks_storage
dom_distiller
domain_reliability
heap_profiling
multi_process
history
invalidation
language
content
browser
ulp_language_code_locator
local_state
media_router
metrics
omnibox
optimization_guide
performance_manager
policy
prefs
privacy_sandbox
proxy_config
safe_browsing
content
browser
core
browser
tailored_security_service
search_provider_logos
security_interstitials
services
shared_highlighting
signin
sync_preferences
tracing
update_client
content
extensions
google_apis
ios
ipc
mojo/public/cpp/base
net
ppapi/shared_impl/private
remoting
rlz/chromeos/lib
services
testing/perf
third_party
blink
renderer
dom_distiller_js
inspector_protocol
tools

@ -293,7 +293,7 @@ void AwMetricsServiceClient::RegisterMetricsPrefs(
PrefRegistrySimple* registry) {
RegisterPrefs(registry);
registry->RegisterDictionaryPref(prefs::kMetricsAppPackageNameLoggingRule,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
registry->RegisterTimePref(prefs::kAppPackageNameLoggingRuleLastUpdateTime,
base::Time());
}

@ -80,7 +80,7 @@ TEST_F(AwTracingDelegateTest, IsAllowedToBeginSessionEndedUnexpectedly) {
tracing::BackgroundTracingStateManager::GetInstance().SaveState(
{}, tracing::BackgroundTracingState::STARTED);
base::Value dict(base::Value::Type::DICTIONARY);
base::Value dict(base::Value::Type::DICT);
tracing::BackgroundTracingStateManager::GetInstance().Initialize(nullptr);
auto config = CreateValidConfig();

@ -72,7 +72,7 @@ AppPackageNameLoggingRule::FromDictionary(const base::Value& dict) {
}
base::Value AppPackageNameLoggingRule::ToDictionary() {
base::Value dict(base::Value::Type::DICTIONARY);
base::Value dict(base::Value::Type::DICT);
dict.SetStringKey(kVersionKey, version_.GetString());
if (!expiry_date_.is_min()) {

@ -51,7 +51,7 @@ TEST_F(AppPackageNameLoggingRuleTest, TestFromDictionary) {
{
absl::optional<AppPackageNameLoggingRule> record =
AppPackageNameLoggingRule::FromDictionary(
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
EXPECT_FALSE(record.has_value());
}
}

@ -1087,15 +1087,15 @@ void AccessibilityControllerImpl::RegisterProfilePrefs(
std::numeric_limits<double>::min());
registry->RegisterDictionaryPref(
prefs::kAccessibilitySwitchAccessSelectDeviceKeyCodes,
base::Value(base::Value::Type::DICTIONARY),
base::Value(base::Value::Type::DICT),
user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF);
registry->RegisterDictionaryPref(
prefs::kAccessibilitySwitchAccessNextDeviceKeyCodes,
base::Value(base::Value::Type::DICTIONARY),
base::Value(base::Value::Type::DICT),
user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF);
registry->RegisterDictionaryPref(
prefs::kAccessibilitySwitchAccessPreviousDeviceKeyCodes,
base::Value(base::Value::Type::DICTIONARY),
base::Value(base::Value::Type::DICT),
user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF);
registry->RegisterBooleanPref(
prefs::kAccessibilitySwitchAccessAutoScanEnabled, false,

@ -512,7 +512,7 @@ void ClipboardHistoryControllerImpl::GetHistoryValuesWithEncodedPNGs(
continue;
}
base::Value item_value(base::Value::Type::DICTIONARY);
base::Value item_value(base::Value::Type::DICT);
switch (clipboard_history_util::CalculateDisplayFormat(item.data())) {
case clipboard_history_util::DisplayFormat::kPng: {
if (!item.data().maybe_png().has_value()) {

@ -1484,7 +1484,7 @@ void ArcNetHostImpl::NetworkListChanged() {
void ArcNetHostImpl::StartLohs(mojom::LohsConfigPtr config,
StartLohsCallback callback) {
NET_LOG(USER) << "Starting LOHS";
base::Value dict(base::Value::Type::DICTIONARY);
base::Value dict(base::Value::Type::DICT);
if (config->hexssid.empty()) {
NET_LOG(ERROR) << "Cannot create local only hotspot without hex ssid";

@ -185,7 +185,7 @@ class KeyboardControllerImplTest : public AshTestBase {
}
void SetKeyboardConfigToPref(const base::Value& value) {
base::Value features(base::Value::Type::DICTIONARY);
base::Value features(base::Value::Type::DICT);
features.SetKey("auto_complete_enabled", value.Clone());
features.SetKey("auto_correct_enabled", value.Clone());
features.SetKey("handwriting_enabled", value.Clone());
@ -270,7 +270,7 @@ TEST_F(KeyboardControllerImplTest,
keyboard_controller()->SetEnableFlag(KeyboardEnableFlag::kExtensionEnabled);
// Set the policy for virtual keyboard features.
base::Value features(base::Value::Type::DICTIONARY);
base::Value features(base::Value::Type::DICT);
PrefService* prefs =
Shell::Get()->session_controller()->GetLastActiveUserPrefService();
prefs->Set(prefs::kAccessibilityVirtualKeyboardFeatures, features);

@ -29,7 +29,7 @@ base::Value HypothesisPartsToValue(
for (auto& part : hypothesis_parts.text)
text_value.Append(part);
base::Value hypothesis_part_value(base::Value::Type::DICTIONARY);
base::Value hypothesis_part_value(base::Value::Type::DICT);
hypothesis_part_value.SetKey(kTextKey, std::move(text_value));
hypothesis_part_value.SetIntKey(
kOffset, hypothesis_parts.hypothesis_part_offset.InMilliseconds());
@ -65,7 +65,7 @@ ProjectorKeyIdea::~ProjectorKeyIdea() = default;
// "endOffset": INT
// "text": STRING
base::Value ProjectorKeyIdea::ToJson() {
base::Value transcript(base::Value::Type::DICTIONARY);
base::Value transcript(base::Value::Type::DICT);
transcript.SetIntKey(kStartOffsetKey, start_time_.InMilliseconds());
transcript.SetIntKey(kEndOffsetKey, end_time_.InMilliseconds());
transcript.SetStringKey(kTextKey, text_);
@ -108,7 +108,7 @@ ProjectorTranscript::~ProjectorTranscript() = default;
// "hypothesisParts": DICT LIST
//
base::Value ProjectorTranscript::ToJson() {
base::Value transcript(base::Value::Type::DICTIONARY);
base::Value transcript(base::Value::Type::DICT);
transcript.SetIntKey(kStartOffsetKey, start_time_.InMilliseconds());
transcript.SetIntKey(kEndOffsetKey, end_time_.InMilliseconds());
transcript.SetStringKey(kTextKey, text_);
@ -191,7 +191,7 @@ std::string ProjectorMetadata::Serialize() {
// "tableOfContent": LIST
// "recognitionStatus": INTEGER
base::Value ProjectorMetadata::ToJson() {
base::Value metadata(base::Value::Type::DICTIONARY);
base::Value metadata(base::Value::Type::DICT);
metadata.SetStringKey(kCaptionLanguage, caption_language_);
base::Value captions_value(base::Value::Type::LIST);

@ -19,14 +19,14 @@ std::string CreateResponseBody(const Geoposition& position) {
value.Set("accuracy", position.accuracy);
if (position.latitude && position.longitude) {
base::Value location(base::Value::Type::DICTIONARY);
base::Value location(base::Value::Type::DICT);
location.SetDoubleKey("lat", position.latitude);
location.SetDoubleKey("lng", position.longitude);
value.Set("location", std::move(location));
}
if (position.error_code) {
base::Value error(base::Value::Type::DICTIONARY);
base::Value error(base::Value::Type::DICT);
error.SetIntKey("error_code", position.error_code);
value.Set("error", std::move(error));
}

@ -183,7 +183,7 @@ class NetworkHealthProviderTest : public testing::Test {
::onc::ONC_SOURCE_DEVICE_POLICY,
/*userhash=*/std::string(),
/*network_configs_onc=*/base::Value(base::Value::Type::LIST),
/*global_network_config=*/base::Value(base::Value::Type::DICTIONARY));
/*global_network_config=*/base::Value(base::Value::Type::DICT));
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
network_health_provider_ = std::make_unique<NetworkHealthProvider>();
@ -382,7 +382,7 @@ class NetworkHealthProviderTest : public testing::Test {
}
void SetCellularSimLockStatus(std::string lock_type, bool sim_locked) {
base::Value sim_lock_status(base::Value::Type::DICTIONARY);
base::Value sim_lock_status(base::Value::Type::DICT);
sim_lock_status.SetKey(shill::kSIMLockEnabledProperty,
base::Value(sim_locked));
sim_lock_status.SetKey(shill::kSIMLockTypeProperty, base::Value(lock_type));

@ -107,7 +107,7 @@ mojom::PowerRoutineResultPtr ConstructPowerRoutineResult(
// the discharge field will be used.
std::string ConstructPowerRoutineResultJson(double charge_percent,
bool charge) {
base::Value result_dict(base::Value::Type::DICTIONARY);
base::Value result_dict(base::Value::Type::DICT);
if (charge) {
result_dict.SetKey(kChargePercentKey, base::Value(charge_percent));
@ -115,7 +115,7 @@ std::string ConstructPowerRoutineResultJson(double charge_percent,
result_dict.SetKey(kDischargePercentKey, base::Value(charge_percent));
}
base::Value output_dict(base::Value::Type::DICTIONARY);
base::Value output_dict(base::Value::Type::DICT);
output_dict.SetKey(kResultDetailsKey, std::move(result_dict));
std::string json;

@ -42,7 +42,7 @@ PendingScreencast& PendingScreencast::operator=(const PendingScreencast&) =
PendingScreencast::~PendingScreencast() = default;
base::Value PendingScreencast::ToValue() const {
base::Value val(base::Value::Type::DICTIONARY);
base::Value val(base::Value::Type::DICT);
val.SetKey(kPendingScreencastName, base::Value(name));
DCHECK_GT(total_size_in_bytes, 0);
const double upload_progress = static_cast<double>(bytes_transferred) /

@ -126,7 +126,7 @@ class VersionUpdaterTest : public testing::Test {
::onc::ONC_SOURCE_DEVICE_POLICY,
/*userhash=*/std::string(),
/*network_configs_onc=*/base::Value(base::Value::Type::LIST),
/*global_network_config=*/base::Value(base::Value::Type::DICTIONARY));
/*global_network_config=*/base::Value(base::Value::Type::DICT));
// Wait until the |managed_network_configuration_handler_| is initialized
// and set up.

@ -299,7 +299,7 @@ void UpdatePrimaryUserDeskMetricsPrefs() {
auto* desks_controller = DesksController::Get();
const auto& desks = desks_controller->desks();
for (const auto& desk : desks) {
base::Value metrics_dict(base::Value::Type::DICTIONARY);
base::Value metrics_dict(base::Value::Type::DICT);
metrics_dict.SetIntKey(
kCreationTimeKey,
desk->creation_time().ToDeltaSinceWindowsEpoch().InMinutes());

@ -240,7 +240,7 @@ NO_INSTRUMENT_FUNCTION bool DumpToFile(const base::FilePath& path) {
// This can get very large as it constructs the whole data structure in
// memory before dumping it to the file.
Value root(Value::Type::DICTIONARY);
Value root(Value::Type::DICT);
uint32_t total_calls_count = g_calls_count.load(std::memory_order_relaxed);
root.SetStringKey("total_calls_count",
base::StringPrintf("%" PRIu32, total_calls_count));
@ -252,7 +252,7 @@ NO_INSTRUMENT_FUNCTION bool DumpToFile(const base::FilePath& path) {
// This callee was never called.
continue;
Value callee_element(Value::Type::DICTIONARY);
Value callee_element(Value::Type::DICT);
uint32_t callee_offset = i * 4;
callee_element.SetStringKey("index",
base::StringPrintf("%" PRIuS, caller_index));
@ -278,7 +278,7 @@ NO_INSTRUMENT_FUNCTION bool DumpToFile(const base::FilePath& path) {
// No misses.
continue;
Value caller_count(Value::Type::DICTIONARY);
Value caller_count(Value::Type::DICT);
caller_count.SetStringKey("caller_offset",
base::StringPrintf("%" PRIu32, caller_offset));
caller_count.SetStringKey("count", base::StringPrintf("%" PRIu32, count));

@ -22,7 +22,7 @@ TEST(JSONWriterTest, BasicTypes) {
EXPECT_EQ("null", output_js);
// Test empty dict.
EXPECT_TRUE(JSONWriter::Write(Value(Value::Type::DICTIONARY), &output_js));
EXPECT_TRUE(JSONWriter::Write(Value(Value::Type::DICT), &output_js));
EXPECT_EQ("{}", output_js);
// Test empty list.

@ -55,7 +55,7 @@ TEST(ValuesUtilTest, InvalidInt64Values) {
std::make_unique<Value>(true),
std::make_unique<Value>(Value::Type::BINARY),
std::make_unique<Value>(Value::Type::LIST),
std::make_unique<Value>(Value::Type::DICTIONARY),
std::make_unique<Value>(Value::Type::DICT),
std::make_unique<Value>(""),
std::make_unique<Value>("abcd"),
std::make_unique<Value>("1234.0"),

@ -48,7 +48,7 @@ TraceEvent& TraceEvent::operator=(TraceEvent&& rhs) = default;
bool TraceEvent::SetFromJSON(const base::Value* event_value) {
if (!event_value->is_dict()) {
LOG(ERROR) << "Value must be Type::DICTIONARY";
LOG(ERROR) << "Value must be Type::DICT";
return false;
}

@ -267,7 +267,7 @@ TEST(ValueIteratorsTest, DictIteratorProxy) {
storage.emplace("double", std::make_unique<Value>(Value::Type::DOUBLE));
storage.emplace("string", std::make_unique<Value>(Value::Type::STRING));
storage.emplace("blob", std::make_unique<Value>(Value::Type::BINARY));
storage.emplace("dict", std::make_unique<Value>(Value::Type::DICTIONARY));
storage.emplace("dict", std::make_unique<Value>(Value::Type::DICT));
storage.emplace("list", std::make_unique<Value>(Value::Type::LIST));
using iterator = const_dict_iterator;
@ -300,7 +300,7 @@ TEST(ValueIteratorsTest, ConstDictIteratorProxy) {
storage.emplace("double", std::make_unique<Value>(Value::Type::DOUBLE));
storage.emplace("string", std::make_unique<Value>(Value::Type::STRING));
storage.emplace("blob", std::make_unique<Value>(Value::Type::BINARY));
storage.emplace("dict", std::make_unique<Value>(Value::Type::DICTIONARY));
storage.emplace("dict", std::make_unique<Value>(Value::Type::DICT));
storage.emplace("list", std::make_unique<Value>(Value::Type::LIST));
using iterator = const_dict_iterator;

@ -160,7 +160,7 @@ Value::Value(Type type) {
case Type::BINARY:
data_.emplace<BlobStorage>();
return;
case Type::DICTIONARY:
case Type::DICT:
data_.emplace<Dict>();
return;
case Type::LIST:
@ -1095,11 +1095,11 @@ std::string* Value::FindStringKey(StringPiece key) {
}
const Value* Value::FindDictKey(StringPiece key) const {
return FindKeyOfType(key, Type::DICTIONARY);
return FindKeyOfType(key, Type::DICT);
}
Value* Value::FindDictKey(StringPiece key) {
return FindKeyOfType(key, Type::DICTIONARY);
return FindKeyOfType(key, Type::DICT);
}
const Value* Value::FindListKey(StringPiece key) const {
@ -1186,7 +1186,7 @@ std::string* Value::FindStringPath(StringPiece path) {
}
const Value* Value::FindDictPath(StringPiece path) const {
return FindPathOfType(path, Type::DICTIONARY);
return FindPathOfType(path, Type::DICT);
}
Value* Value::FindDictPath(StringPiece path) {
@ -1305,7 +1305,7 @@ Value* Value::SetPath(span<const StringPiece> path, Value&& value) {
if (found == cur->dict().end() || found->first != path_component) {
// No key found, insert one.
auto inserted = cur->dict().try_emplace(
found, path_component, std::make_unique<Value>(Type::DICTIONARY));
found, path_component, std::make_unique<Value>(Type::DICT));
cur = inserted->second.get();
} else {
cur = found->second.get();
@ -1393,7 +1393,7 @@ size_t Value::EstimateMemoryUsage() const {
return base::trace_event::EstimateMemoryUsage(GetString());
case Type::BINARY:
return base::trace_event::EstimateMemoryUsage(GetBlob());
case Type::DICTIONARY:
case Type::DICT:
return base::trace_event::EstimateMemoryUsage(dict());
case Type::LIST:
return GetList().EstimateMemoryUsage();

@ -198,8 +198,6 @@ class BASE_EXPORT GSL_OWNER Value {
STRING,
BINARY,
DICT,
// TODO(https://crbug.com/1291670): Deprecated and will be removed.
DICTIONARY = DICT,
LIST,
// Note: Do not add more types. See the file-level comment above for why.
};

@ -184,7 +184,7 @@ TEST(ValuesTest, ConstructBinary) {
TEST(ValuesTest, ConstructDict) {
Value::Dict value;
EXPECT_EQ(Value::Type::DICTIONARY, Value(std::move(value)).type());
EXPECT_EQ(Value::Type::DICT, Value(std::move(value)).type());
}
TEST(ValuesTest, ConstructDictFromValueDict) {
@ -441,7 +441,7 @@ TEST(ValuesTest, MoveConstructDictionary) {
Value value(std::move(dict));
Value moved_value(std::move(value));
EXPECT_EQ(Value::Type::DICTIONARY, moved_value.type());
EXPECT_EQ(Value::Type::DICT, moved_value.type());
EXPECT_EQ(123, moved_value.GetDict().Find("Int")->GetInt());
}
@ -451,7 +451,7 @@ TEST(ValuesTest, MoveAssignDictionary) {
Value blank;
blank = Value(std::move(dict));
EXPECT_EQ(Value::Type::DICTIONARY, blank.type());
EXPECT_EQ(Value::Type::DICT, blank.type());
EXPECT_EQ(123, blank.GetDict().Find("Int")->GetInt());
}
@ -462,7 +462,7 @@ TEST(ValuesTest, ConstructDictWithIterators) {
Value blank;
blank = Value(Value::Dict(std::make_move_iterator(values.begin()),
std::make_move_iterator(values.end())));
EXPECT_EQ(Value::Type::DICTIONARY, blank.type());
EXPECT_EQ(Value::Type::DICT, blank.type());
EXPECT_EQ(123, blank.GetDict().Find("Int")->GetInt());
}
@ -836,7 +836,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::NONE));
EXPECT_NE(nullptr, value.FindKeyOfType("bool", Value::Type::BOOLEAN));
@ -845,7 +845,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::BOOLEAN));
@ -854,7 +854,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::BOOLEAN));
@ -863,7 +863,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::BOOLEAN));
@ -872,7 +872,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_NE(nullptr, value.FindKeyOfType("string", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::BOOLEAN));
@ -881,7 +881,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::STRING));
EXPECT_NE(nullptr, value.FindKeyOfType("blob", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::BOOLEAN));
@ -890,7 +890,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::BINARY));
EXPECT_NE(nullptr, value.FindKeyOfType("list", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::BOOLEAN));
@ -899,7 +899,7 @@ TEST(ValuesTest, FindKeyOfType) {
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::LIST));
EXPECT_NE(nullptr, value.FindKeyOfType("dict", Value::Type::DICTIONARY));
EXPECT_NE(nullptr, value.FindKeyOfType("dict", Value::Type::DICT));
}
TEST(ValuesTest, FindKeyOfTypeConst) {
@ -921,7 +921,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("null", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::NONE));
EXPECT_NE(nullptr, value.FindKeyOfType("bool", Value::Type::BOOLEAN));
@ -930,7 +930,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("bool", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::BOOLEAN));
@ -939,7 +939,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("int", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::BOOLEAN));
@ -948,7 +948,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("double", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::BOOLEAN));
@ -957,7 +957,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_NE(nullptr, value.FindKeyOfType("string", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("string", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::BOOLEAN));
@ -966,7 +966,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::STRING));
EXPECT_NE(nullptr, value.FindKeyOfType("blob", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("blob", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::BOOLEAN));
@ -975,7 +975,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::BINARY));
EXPECT_NE(nullptr, value.FindKeyOfType("list", Value::Type::LIST));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::DICTIONARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("list", Value::Type::DICT));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::NONE));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::BOOLEAN));
@ -984,7 +984,7 @@ TEST(ValuesTest, FindKeyOfTypeConst) {
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::STRING));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::BINARY));
EXPECT_EQ(nullptr, value.FindKeyOfType("dict", Value::Type::LIST));
EXPECT_NE(nullptr, value.FindKeyOfType("dict", Value::Type::DICTIONARY));
EXPECT_NE(nullptr, value.FindKeyOfType("dict", Value::Type::DICT));
}
TEST(ValuesTest, FindBoolKey) {
@ -1169,7 +1169,7 @@ TEST(ValuesTest, SetKey) {
dict2.Set(std::string("string"), Value(Value::Type::STRING));
dict2.Set("blob", Value(Value::Type::BINARY));
dict2.Set("list", Value(Value::Type::LIST));
dict2.Set("dict", Value(Value::Type::DICTIONARY));
dict2.Set("dict", Value(Value::Type::DICT));
EXPECT_EQ(dict, dict2);
EXPECT_EQ(Value(std::move(dict)), Value(std::move(dict2)));
@ -1631,7 +1631,7 @@ TEST(ValuesTest, DictionarySetReturnsPointer) {
{
Value::Dict dict;
Value* dict_ptr = dict.Set("foo.bar", Value::Dict());
EXPECT_EQ(Value::Type::DICTIONARY, dict_ptr->type());
EXPECT_EQ(Value::Type::DICT, dict_ptr->type());
}
{
@ -1658,8 +1658,7 @@ TEST(ValuesTest, Clone) {
list.Append(1);
Value* list_weak = original_dict.Set("list", Value(std::move(list)));
Value* dict_weak =
original_dict.Set("dictionary", Value(Value::Type::DICTIONARY));
Value* dict_weak = original_dict.Set("dictionary", Value(Value::Type::DICT));
dict_weak->GetDict().Set("key", "value");
Value::Dict copy_dict = original_dict.Clone();
@ -1884,7 +1883,7 @@ TEST(ValuesTest, Equals) {
Value::List list;
list.Append(Value());
list.Append(Value(Value::Type::DICTIONARY));
list.Append(Value(Value::Type::DICT));
Value::List list_copy(list.Clone());
Value* list_weak = dv.Set("f", std::move(list));

@ -121,7 +121,7 @@ TEST_F(MicroBenchmarkControllerTest, MultipleBenchmarkRan) {
TEST_F(MicroBenchmarkControllerTest, BenchmarkImplRan) {
int run_count = 0;
base::Value settings(base::Value::Type::DICTIONARY);
base::Value settings(base::Value::Type::DICT);
settings.SetBoolKey("run_benchmark_impl", true);
// Schedule a main thread benchmark.
@ -146,7 +146,7 @@ TEST_F(MicroBenchmarkControllerTest, BenchmarkImplRan) {
TEST_F(MicroBenchmarkControllerTest, SendMessage) {
// Send valid message to invalid benchmark (id = 0)
base::Value message(base::Value::Type::DICTIONARY);
base::Value message(base::Value::Type::DICT);
message.SetBoolKey("can_handle", true);
bool message_handled =
layer_tree_host_->SendMessageToMicroBenchmark(0, std::move(message));
@ -160,14 +160,14 @@ TEST_F(MicroBenchmarkControllerTest, SendMessage) {
EXPECT_GT(id, 0);
// Send valid message to valid benchmark
message = base::Value(base::Value::Type::DICTIONARY);
message = base::Value(base::Value::Type::DICT);
message.SetBoolKey("can_handle", true);
message_handled =
layer_tree_host_->SendMessageToMicroBenchmark(id, std::move(message));
EXPECT_TRUE(message_handled);
// Send invalid message to valid benchmark
message = base::Value(base::Value::Type::DICTIONARY);
message = base::Value(base::Value::Type::DICT);
message.SetBoolKey("can_handle", false);
message_handled =
layer_tree_host_->SendMessageToMicroBenchmark(id, std::move(message));

@ -73,7 +73,7 @@ void RasterizeAndRecordBenchmark::DidUpdateLayers(
paint_benchmark_result);
DCHECK(results_.is_none());
results_ = base::Value(base::Value::Type::DICTIONARY);
results_ = base::Value(base::Value::Type::DICT);
results_.SetIntKey("pixels_recorded", record_results_.pixels_recorded);
results_.SetIntKey("paint_op_memory_usage",
static_cast<int>(record_results_.paint_op_memory_usage));

@ -160,7 +160,7 @@ void RasterizeAndRecordBenchmarkImpl::DidCompleteCommit(
layer->RunMicroBenchmark(this);
}
base::Value result(base::Value::Type::DICTIONARY);
base::Value result(base::Value::Type::DICT);
result.SetDoubleKey("rasterize_time_ms",
rasterize_results_.total_best_time.InMillisecondsF());
result.SetIntKey("pixels_rasterized", rasterize_results_.pixels_rasterized);
@ -176,7 +176,7 @@ void RasterizeAndRecordBenchmarkImpl::DidCompleteCommit(
result.SetIntKey("total_picture_layers_off_screen",
rasterize_results_.total_picture_layers_off_screen);
base::Value lcd_text_pixels(base::Value::Type::DICTIONARY);
base::Value lcd_text_pixels(base::Value::Type::DICT);
for (size_t i = 0; i < kLCDTextDisallowedReasonCount; i++) {
lcd_text_pixels.SetIntKey(
LCDTextDisallowedReasonToString(

@ -91,9 +91,9 @@ std::string GetInputEventSourceKey(InputEventSource event_source) {
base::Value ConvertEventCountsToValue(
const AppPlatformInputMetrics::EventSourceToCounts& event_counts) {
base::Value event_counts_dict(base::Value::Type::DICTIONARY);
base::Value event_counts_dict(base::Value::Type::DICT);
for (const auto& counts : event_counts) {
base::Value count_dict(base::Value::Type::DICTIONARY);
base::Value count_dict(base::Value::Type::DICT);
for (const auto& it : counts.second) {
count_dict.SetIntKey(GetAppTypeHistogramName(it.first), it.second);
}

@ -400,7 +400,7 @@ AppPlatformMetrics::UsageTime::UsageTime(const base::Value& value) {
}
base::Value AppPlatformMetrics::UsageTime::ConvertToValue() const {
base::Value usage_time_dict(base::Value::Type::DICTIONARY);
base::Value usage_time_dict(base::Value::Type::DICT);
usage_time_dict.SetStringKey(kUsageTimeAppIdKey, app_id);
usage_time_dict.SetStringKey(kUsageTimeAppTypeKey,
GetAppTypeHistogramName(app_type_name));

@ -147,7 +147,7 @@ WebsiteMetrics::UrlInfo::UrlInfo(const base::Value& value) {
}
base::Value WebsiteMetrics::UrlInfo::ConvertToValue() const {
base::Value usage_time_dict(base::Value::Type::DICTIONARY);
base::Value usage_time_dict(base::Value::Type::DICT);
usage_time_dict.SetPath(kRunningTimeKey,
base::TimeDeltaToValue(running_time_in_two_hours));
usage_time_dict.SetBoolKey(kPromotableKey, promotable);

@ -30,14 +30,14 @@ base::Value GetAutoDisplayDictForSettings(
const HostContentSettingsMap* settings,
const GURL& url) {
if (!settings)
return base::Value(base::Value::Type::DICTIONARY);
return base::Value(base::Value::Type::DICT);
base::Value value = settings->GetWebsiteSetting(
url, url, ContentSettingsType::INTENT_PICKER_DISPLAY, /*info=*/nullptr);
return value.type() == base::Value::Type::DICTIONARY
return value.type() == base::Value::Type::DICT
? std::move(value)
: base::Value(base::Value::Type::DICTIONARY);
: base::Value(base::Value::Type::DICT);
}
} // namespace

@ -630,7 +630,7 @@ TEST_F(BrowserUtilTest, RecordDataVer) {
base::Version version{"1.1.1.1"};
browser_util::RecordDataVer(&pref_service_, user_id_hash, version);
base::Value expected{base::Value::Type::DICTIONARY};
base::Value expected{base::Value::Type::DICT};
expected.SetStringKey(user_id_hash, version.GetString());
const base::Value::Dict& dict =
pref_service_.GetDict(browser_util::kDataVerPref);
@ -645,7 +645,7 @@ TEST_F(BrowserUtilTest, RecordDataVerOverrides) {
browser_util::RecordDataVer(&pref_service_, user_id_hash, version1);
browser_util::RecordDataVer(&pref_service_, user_id_hash, version2);
base::Value expected{base::Value::Type::DICTIONARY};
base::Value expected{base::Value::Type::DICT};
expected.SetStringKey(user_id_hash, version2.GetString());
const base::Value::Dict& dict =
@ -667,7 +667,7 @@ TEST_F(BrowserUtilTest, RecordDataVerWithMultipleUsers) {
base::Version version3{"3.3.3.3"};
browser_util::RecordDataVer(&pref_service_, user_id_hash_1, version3);
base::Value expected{base::Value::Type::DICTIONARY};
base::Value expected{base::Value::Type::DICT};
expected.SetStringKey(user_id_hash_1, version3.GetString());
expected.SetStringKey(user_id_hash_2, version2.GetString());

@ -417,7 +417,7 @@ void ExtensionInfoPrivateAsh::BindReceiver(
void ExtensionInfoPrivateAsh::GetSystemProperties(
const std::vector<std::string>& property_names,
GetSystemPropertiesCallback callback) {
base::Value result(base::Value::Type::DICTIONARY);
base::Value result(base::Value::Type::DICT);
for (const std::string& property_name : property_names) {
std::unique_ptr<base::Value> value = GetValue(property_name);
if (value) {

@ -778,7 +778,7 @@ TEST_F(LocalPrinterAshTest, GetPolicies_Unset) {
TEST_F(LocalPrinterAshTest, GetPolicies_PaperSize) {
auto* prefs = GetPrefs();
base::Value paper_size(base::Value::Type::DICTIONARY);
base::Value paper_size(base::Value::Type::DICT);
paper_size.SetStringKey(kPaperSizeName, "iso_a4_210x297mm");
prefs->Set("printing.paper_size_default", std::move(paper_size));

@ -121,7 +121,7 @@ void NetworkSettingsServiceAsh::SetExtensionProxy(
// Required to display the extension which is controlling the proxy in the OS
// Settings > Network > Proxy window.
base::Value proxy_extension(base::Value::Type::DICTIONARY);
base::Value proxy_extension(base::Value::Type::DICT);
proxy_extension.SetStringKey(kPrefExtensionNameKey,
proxy_config->extension->name);
proxy_extension.SetStringKey(kPrefExtensionIdKey,

@ -215,7 +215,7 @@ class NetworkSettingsServiceAshExtensionTest
proxy_config->extension->can_be_disabled = can_be_disabled;
network_service_ash_->SetExtensionProxy(std::move(proxy_config));
base::Value expected_pref(base::Value::Type::DICTIONARY);
base::Value expected_pref(base::Value::Type::DICT);
expected_pref.SetStringKey(kPrefExtensionNameKey, kExtensionName);
expected_pref.SetStringKey(kPrefExtensionIdKey, kExtensionId);
expected_pref.SetBoolKey(kPrefExtensionCanDisabled, can_be_disabled);
@ -271,7 +271,7 @@ IN_PROC_BROWSER_TEST_F(NetworkSettingsServiceAshExtensionTest,
ASSERT_FALSE(result.is_null());
EXPECT_TRUE(result->extension.is_null());
EXPECT_EQ(*(extension_proxy_pref->GetValue()),
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
// proxy_mode=system is the default value (see
// PrefProxyConfigTrackerImpl::RegisterProfilePrefs).
EXPECT_EQ(*(proxy_pref->GetValue()), ProxyConfigDictionary::CreateSystem());

@ -222,7 +222,7 @@ void DeviceStateListCallbackAdapter(
if (result->at(i)) {
list->push_back(base::Value(result->at(i)->ToValue()));
} else {
list->push_back(base::Value(base::Value::Type::DICTIONARY));
list->push_back(base::Value(base::Value::Type::DICT));
}
}

@ -199,7 +199,7 @@ void ExtensionsPermissionsTracker::OnForcedExtensionsPrefChanged() {
// installation_mode: forced.
const base::Value& value =
pref_service_->GetValue(pref_names::kInstallForceList);
if (value.type() != base::Value::Type::DICTIONARY) {
if (value.type() != base::Value::Type::DICT) {
return;
}

@ -80,7 +80,7 @@ ui::KeyEvent CreateRepeatKeyEvent(const ui::DomCode& code) {
void SetInputMethodOptions(Profile& profile,
bool predictive_writing_enabled,
bool diacritics_on_longpress_enabled) {
base::Value input_method_setting(base::Value::Type::DICTIONARY);
base::Value input_method_setting(base::Value::Type::DICT);
input_method_setting.SetPath(std::string(kUsEnglishEngineId) +
".physicalKeyboardEnablePredictiveWriting",
base::Value(predictive_writing_enabled));

@ -389,7 +389,7 @@ ui::KeyEvent KeyA() {
void SetAutocorrectPreferenceTo(Profile& profile,
const std::string& engine_id,
int autocorrect_level) {
base::Value input_method_setting(base::Value::Type::DICTIONARY);
base::Value input_method_setting(base::Value::Type::DICT);
input_method_setting.SetPath(
engine_id + ".physicalKeyboardAutoCorrectionLevel",
base::Value(autocorrect_level));

@ -24,7 +24,7 @@ void SetAutocorrectLevelTo(Profile& profile,
const std::string& pref_name,
const std::string& engine_id,
int autocorrect_level) {
base::Value input_method_setting(base::Value::Type::DICTIONARY);
base::Value input_method_setting(base::Value::Type::DICT);
input_method_setting.SetPath(base::StrCat({engine_id, ".", pref_name}),
base::Value(autocorrect_level));
profile.GetPrefs()->Set(::prefs::kLanguageInputMethodSpecificSettings,

@ -141,7 +141,7 @@ class MockInputMethod : public ime::mojom::InputMethod {
void SetInputMethodOptions(Profile& profile,
bool autocorrect_enabled,
bool predictive_writing_enabled) {
base::Value input_method_setting(base::Value::Type::DICTIONARY);
base::Value input_method_setting(base::Value::Type::DICT);
input_method_setting.SetPath(
std::string(kEngineIdUs) + ".physicalKeyboardAutoCorrectionLevel",
base::Value(autocorrect_enabled ? 1 : 0));
@ -161,7 +161,7 @@ void SetInputMethodOptionsJapaneseMigrationCompleted(
}
void SetPinyinLayoutPrefs(Profile& profile, const std::string& layout) {
base::Value input_method_setting(base::Value::Type::DICTIONARY);
base::Value input_method_setting(base::Value::Type::DICT);
input_method_setting.SetStringPath("zh-t-i0-pinyin.xkbLayout", layout);
profile.GetPrefs()->Set(::prefs::kLanguageInputMethodSpecificSettings,
input_method_setting);

@ -57,8 +57,9 @@ base::flat_set<std::string> GetLoginScreenPolicyExtensionIds() {
const PrefService::Preference* const pref =
prefs->FindPreference(extensions::pref_names::kInstallForceList);
if (!pref || !pref->IsManaged() ||
pref->GetType() != base::Value::Type::DICTIONARY)
pref->GetType() != base::Value::Type::DICT) {
return {};
}
base::flat_set<std::string> extension_ids;
for (const auto item : pref->GetValue()->DictItems())

@ -190,7 +190,7 @@ class DemoExtensionsExternalLoaderTest : public testing::Test {
base::Value* config) {
ASSERT_TRUE(config->is_dict());
base::Value extension(base::Value::Type::DICTIONARY);
base::Value extension(base::Value::Type::DICT);
if (version.has_value()) {
extension.SetKey(extensions::ExternalProviderImpl::kExternalVersion,
base::Value(version.value()));
@ -265,7 +265,7 @@ TEST_F(DemoExtensionsExternalLoaderTest, InvalidDemoExtensionsConfig) {
TEST_F(DemoExtensionsExternalLoaderTest, SingleDemoExtension) {
demo_mode_test_helper_->InitializeSession();
base::Value config = base::Value(base::Value::Type::DICTIONARY);
base::Value config = base::Value(base::Value::Type::DICT);
AddExtensionToConfig(std::string(32, 'a'), absl::make_optional("1.0.0"),
absl::make_optional("extensions/a.crx"), &config);
ASSERT_TRUE(SetExtensionsConfig(std::move(config)));
@ -286,7 +286,7 @@ TEST_F(DemoExtensionsExternalLoaderTest, SingleDemoExtension) {
TEST_F(DemoExtensionsExternalLoaderTest, MultipleDemoExtension) {
demo_mode_test_helper_->InitializeSession();
base::Value config = base::Value(base::Value::Type::DICTIONARY);
base::Value config = base::Value(base::Value::Type::DICT);
AddExtensionToConfig(std::string(32, 'a'), absl::make_optional("1.0.0"),
absl::make_optional("extensions/a.crx"), &config);
AddExtensionToConfig(std::string(32, 'b'), absl::make_optional("1.1.0"),
@ -317,7 +317,7 @@ TEST_F(DemoExtensionsExternalLoaderTest, MultipleDemoExtension) {
TEST_F(DemoExtensionsExternalLoaderTest, CrxPathWithAbsolutePath) {
demo_mode_test_helper_->InitializeSession();
base::Value config = base::Value(base::Value::Type::DICTIONARY);
base::Value config = base::Value(base::Value::Type::DICT);
AddExtensionToConfig(std::string(32, 'a'), absl::make_optional("1.0.0"),
absl::make_optional("a.crx"), &config);
AddExtensionToConfig(std::string(32, 'b'), absl::make_optional("1.1.0"),
@ -343,7 +343,7 @@ TEST_F(DemoExtensionsExternalLoaderTest, CrxPathWithAbsolutePath) {
TEST_F(DemoExtensionsExternalLoaderTest, ExtensionWithPathMissing) {
demo_mode_test_helper_->InitializeSession();
base::Value config = base::Value(base::Value::Type::DICTIONARY);
base::Value config = base::Value(base::Value::Type::DICT);
AddExtensionToConfig(std::string(32, 'a'), absl::make_optional("1.0.0"),
absl::make_optional("a.crx"), &config);
AddExtensionToConfig(std::string(32, 'b'), absl::make_optional("1.1.0"),
@ -368,7 +368,7 @@ TEST_F(DemoExtensionsExternalLoaderTest, ExtensionWithPathMissing) {
TEST_F(DemoExtensionsExternalLoaderTest, ExtensionWithVersionMissing) {
demo_mode_test_helper_->InitializeSession();
base::Value config = base::Value(base::Value::Type::DICTIONARY);
base::Value config = base::Value(base::Value::Type::DICT);
AddExtensionToConfig(std::string(32, 'a'), absl::make_optional("1.0.0"),
absl::make_optional("a.crx"), &config);
AddExtensionToConfig(std::string(32, 'b'), absl::nullopt,
@ -406,7 +406,7 @@ TEST_F(DemoExtensionsExternalLoaderTest,
StartLoaderBeforeOfflineResourcesLoaded) {
demo_mode_test_helper_->InitializeSessionWithPendingComponent();
base::Value config = base::Value(base::Value::Type::DICTIONARY);
base::Value config = base::Value(base::Value::Type::DICT);
AddExtensionToConfig(std::string(32, 'a'), absl::make_optional("1.0.0"),
absl::make_optional("a.crx"), &config);
ASSERT_TRUE(SetExtensionsConfig(std::move(config)));
@ -430,7 +430,7 @@ TEST_F(DemoExtensionsExternalLoaderTest,
StartLoaderBeforeOfflineResourcesLoadFails) {
demo_mode_test_helper_->InitializeSessionWithPendingComponent();
base::Value config = base::Value(base::Value::Type::DICTIONARY);
base::Value config = base::Value(base::Value::Type::DICT);
AddExtensionToConfig(std::string(32, 'a'), absl::make_optional("1.0.0"),
absl::make_optional("a.crx"), &config);
ASSERT_TRUE(SetExtensionsConfig(std::move(config)));

@ -461,7 +461,7 @@ std::string DemoSetupController::GetSubOrganizationEmail() {
// static
base::Value DemoSetupController::GetDemoSetupSteps() {
base::Value setup_steps_dict(base::Value::Type::DICTIONARY);
base::Value setup_steps_dict(base::Value::Type::DICT);
for (auto entry : GetDemoSetupStepsInfo()) {
setup_steps_dict.SetIntPath(GetDemoSetupStepString(entry.step),
entry.step_index);

@ -160,7 +160,7 @@ LoginScreenExtensionsLifetimeManager::GetPolicyExtensionIds() const {
const PrefService::Preference* const pref =
prefs->FindPreference(extensions::pref_names::kInstallForceList);
if (!pref || !pref->IsManaged() ||
pref->GetType() != base::Value::Type::DICTIONARY) {
pref->GetType() != base::Value::Type::DICT) {
return {};
}
extensions::ExtensionIdList extension_ids;

@ -44,8 +44,7 @@ void LoginScreenExtensionsStorageCleaner::
std::vector<std::string> installed_extension_ids;
const PrefService::Preference* const pref =
prefs_->FindPreference(extensions::pref_names::kInstallForceList);
if (pref && pref->IsManaged() &&
pref->GetType() == base::Value::Type::DICTIONARY) {
if (pref && pref->IsManaged() && pref->GetType() == base::Value::Type::DICT) {
// Each `item` contains a pair of extension ID and update URL.
for (const auto item : pref->GetValue()->DictItems())
installed_extension_ids.push_back(item.first);

@ -189,7 +189,7 @@ void PasswordSyncTokenFetcher::OnAccessTokenFetchComplete(
}
void PasswordSyncTokenFetcher::FetchSyncToken(const std::string& access_token) {
base::Value request_data(base::Value::Type::DICTIONARY);
base::Value request_data(base::Value::Type::DICT);
request_data.SetStringKey(kTokenTypeKey, kTokenTypeValue);
std::string request_string;
if (!base::JSONWriter::Write(request_data, &request_string)) {
@ -288,10 +288,10 @@ void PasswordSyncTokenFetcher::OnSimpleLoaderComplete(
deserializer.Deserialize(/*error_code=*/nullptr, &error_msg);
if (!response_body || (response_code != net::HTTP_OK)) {
const auto* error_json = json_value && json_value->is_dict()
? json_value->FindKeyOfType(
kErrorKey, base::Value::Type::DICTIONARY)
: nullptr;
const auto* error_json =
json_value && json_value->is_dict()
? json_value->FindKeyOfType(kErrorKey, base::Value::Type::DICT)
: nullptr;
const auto* error_value =
error_json ? error_json->FindKeyOfType(kErrorDescription,
base::Value::Type::STRING)

@ -188,7 +188,7 @@ void SessionFlagsManager::StoreStateToBackingFile() {
user_profile = it->second;
}
base::Value cached_state(base::Value::Type::DICTIONARY);
base::Value cached_state(base::Value::Type::DICT);
// Restart job command line should already contain login user and profile
// switches, no reason to store it separately.

@ -67,7 +67,7 @@ base::Value ManagedOncCreatePasswordDict(const base::Value& network,
source = onc::kAugmentationSharedSetting;
}
base::Value password_dict(base::Value::Type::DICTIONARY);
base::Value password_dict(base::Value::Type::DICT);
password_dict.SetStringKey(onc::kAugmentationActiveSetting, password);
password_dict.SetStringKey(onc::kAugmentationEffectiveSetting, source);
password_dict.SetStringKey(source, password);

@ -80,7 +80,7 @@ void SecureDnsManager::LoadProviders() {
base::Value SecureDnsManager::GetProviders(const std::string& mode,
const std::string& templates) {
base::Value doh_providers(base::Value::Type::DICTIONARY);
base::Value doh_providers(base::Value::Type::DICT);
if (mode == SecureDnsConfig::kModeOff)
return doh_providers.Clone();

@ -56,7 +56,7 @@ void OnGetProperties(bool* success_out,
*success_out = result.has_value();
if (result) {
base::Value* value = result->FindKeyOfType(
shill::kDNSProxyDOHProvidersProperty, base::Value::Type::DICTIONARY);
shill::kDNSProxyDOHProvidersProperty, base::Value::Type::DICT);
if (value != nullptr) {
for (const auto kv : value->DictItems()) {
props_out->emplace(kv.first, kv.second.GetString());

@ -566,7 +566,7 @@ IN_PROC_BROWSER_TEST_F(SystemProxyManagerPolicyCredentialsBrowserTest,
ExpectSystemCredentialsSent("", "");
// Configure a proxy via user policy.
base::Value proxy_config(base::Value::Type::DICTIONARY);
base::Value proxy_config(base::Value::Type::DICT);
proxy_config.SetKey("mode", base::Value(ProxyPrefs::kPacScriptProxyModeName));
proxy_config.SetKey("pac_url", base::Value("http://proxy"));
browser()->profile()->GetPrefs()->Set(::proxy_config::prefs::kProxy,
@ -661,7 +661,7 @@ class SystemProxyCredentialsReuseBrowserTest
void SetManagedProxy() {
// Configure a proxy via user policy.
base::Value proxy_config(base::Value::Type::DICTIONARY);
base::Value proxy_config(base::Value::Type::DICT);
proxy_config.SetKey("mode",
base::Value(ProxyPrefs::kFixedServersProxyModeName));
proxy_config.SetKey(

@ -85,7 +85,7 @@ network::NetworkService* GetNetworkService() {
void SetManagedProxy(Profile* profile) {
// Configure a proxy via user policy.
base::Value proxy_config(base::Value::Type::DICTIONARY);
base::Value proxy_config(base::Value::Type::DICT);
proxy_config.SetKey("mode",
base::Value(ProxyPrefs::kFixedServersProxyModeName));
proxy_config.SetKey("server", base::Value(kProxyAuthUrl));

@ -932,7 +932,7 @@ void DecodeGenericPolicies(const em::ChromeDeviceSettingsProto& policy,
// Set empty value if policy is missing, to make sure that webui
// will receive setting update.
new_values_cache->SetValue(kDeviceDisplayResolution,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
}
if (policy.has_allow_bluetooth() &&

@ -27,7 +27,7 @@ constexpr char kUseKerberosKey[] = "use_kerberos";
constexpr char kPasswordSaltKey[] = "password_salt";
base::Value ShareToDict(const SmbShareInfo& share) {
base::Value dict(base::Value::Type::DICTIONARY);
base::Value dict(base::Value::Type::DICT);
dict.SetStringKey(kShareUrlKey, share.share_url().ToString());
dict.SetStringKey(kDisplayNameKey, share.display_name());
dict.SetBoolKey(kUseKerberosKey, share.use_kerberos());

@ -60,7 +60,7 @@ void WriteAppLocale(std::string app_locale) {
if (!GetCacheFilePath(&cache_file))
return;
base::Value settings(base::Value::Type::DICTIONARY);
base::Value settings(base::Value::Type::DICT);
settings.SetKey(kAppLocaleKey, base::Value(app_locale));
std::string output;

@ -69,7 +69,7 @@ class CrosapiSystemLogSourceTest : public ::testing::Test {
TEST_F(CrosapiSystemLogSourceTest, OnFeedbackData) {
// Set up FakeBrowserManager to send log data with 1 log entry for
// the log source.
base::Value system_log_entries(base::Value::Type::DICTIONARY);
base::Value system_log_entries(base::Value::Type::DICT);
system_log_entries.SetStringKey("testing log key", "testing log content");
SetupBrowserManagerResponse(std::move(system_log_entries));

@ -148,7 +148,7 @@ void ShillLogSource::AddDeviceAndRequestIPConfigs(
}
if (!ip_config_paths_.empty()) {
device->SetKey(shill::kIPConfigsProperty,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
}
}
@ -239,8 +239,8 @@ void ShillLogSource::CheckIfDone() {
response[kNetworkServices] = std::move(json);
// Clear |devices_| and |services_|.
devices_ = base::Value(base::Value::Type::DICTIONARY);
services_ = base::Value(base::Value::Type::DICTIONARY);
devices_ = base::Value(base::Value::Type::DICT);
services_ = base::Value(base::Value::Type::DICT);
std::move(callback_).Run(
std::make_unique<SystemLogsResponse>(std::move(response)));

@ -55,8 +55,8 @@ class ShillLogSource : public SystemLogsSource {
std::set<std::string> service_paths_;
// More than one device may request the same IP configs, so use multiset.
std::multiset<std::string> ip_config_paths_;
base::Value devices_{base::Value::Type::DICTIONARY};
base::Value services_{base::Value::Type::DICTIONARY};
base::Value devices_{base::Value::Type::DICT};
base::Value services_{base::Value::Type::DICT};
base::WeakPtrFactory<ShillLogSource> weak_ptr_factory_{this};
};

@ -10,7 +10,7 @@
namespace ash {
base::Value SystemWebAppData::AsDebugValue() const {
base::Value root(base::Value::Type::DICTIONARY);
base::Value root(base::Value::Type::DICT);
root.SetIntKey("system_app_type", static_cast<int>(system_app_type));
return root;
}

@ -2481,16 +2481,16 @@ TEST_F(ChromeBrowsingDataRemoverDelegateTest,
HostContentSettingsMapFactory::GetForProfile(GetProfile());
host_content_settings_map->SetWebsiteSettingDefaultScope(
kOrigin1, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
host_content_settings_map->SetWebsiteSettingDefaultScope(
kOrigin2, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
host_content_settings_map->SetWebsiteSettingDefaultScope(
kOrigin3, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
host_content_settings_map->SetWebsiteSettingDefaultScope(
kOrigin4, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
// Clear all except for origin1 and origin3.
std::unique_ptr<BrowsingDataFilterBuilder> filter(

@ -182,10 +182,9 @@ TEST_F(SiteSettingsCounterTest, OnlyCountContentSettings) {
map()->SetContentSettingDefaultScope(
GURL("http://www.google.com"), GURL("http://www.google.com"),
ContentSettingsType::POPUPS, CONTENT_SETTING_ALLOW);
map()->SetWebsiteSettingDefaultScope(
GURL("http://maps.google.com"), GURL(),
ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
map()->SetWebsiteSettingDefaultScope(GURL("http://maps.google.com"), GURL(),
ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICT));
counter()->Restart();
EXPECT_EQ(1, GetResult());
@ -193,10 +192,10 @@ TEST_F(SiteSettingsCounterTest, OnlyCountContentSettings) {
// Tests that the counter counts WebUSB settings
TEST_F(SiteSettingsCounterTest, CountWebUsbSettings) {
map()->SetWebsiteSettingDefaultScope(
GURL("http://www.google.com"), GURL("http://www.google.com"),
ContentSettingsType::USB_CHOOSER_DATA,
base::Value(base::Value::Type::DICTIONARY));
map()->SetWebsiteSettingDefaultScope(GURL("http://www.google.com"),
GURL("http://www.google.com"),
ContentSettingsType::USB_CHOOSER_DATA,
base::Value(base::Value::Type::DICT));
counter()->Restart();
EXPECT_EQ(1, GetResult());

@ -87,9 +87,9 @@ std::string CartDiscountLinkFetcher::GeneratePostData(
const cart_db::ChromeCartDiscountProto& cart_discount_proto =
cart_content_proto.discount_info();
base::Value discount_dict(base::Value::Type::DICTIONARY);
base::Value discount_dict(base::Value::Type::DICT);
// MerchantIdentifier
base::Value merchant_identifier_dict(base::Value::Type::DICTIONARY);
base::Value merchant_identifier_dict(base::Value::Type::DICT);
merchant_identifier_dict.SetStringKey("cartUrl",
cart_content_proto.merchant_cart_url());
merchant_identifier_dict.SetStringKey("merchantId",
@ -106,7 +106,7 @@ std::string CartDiscountLinkFetcher::GeneratePostData(
const cart_db::RuleDiscountInfoProto& rule_discount_info_proto =
cart_discount_proto.rule_discount_info(i);
base::Value rule_discount(base::Value::Type::DICTIONARY);
base::Value rule_discount(base::Value::Type::DICT);
// ruleId
rule_discount.SetStringKey("ruleId", rule_discount_info_proto.rule_id());
// merchanRuletId
@ -119,9 +119,9 @@ std::string CartDiscountLinkFetcher::GeneratePostData(
rule_discount_info_proto.raw_merchant_offer_id());
}
// discount
base::Value discount(base::Value::Type::DICTIONARY);
base::Value discount(base::Value::Type::DICT);
if (rule_discount_info_proto.has_amount_off()) {
base::Value money(base::Value::Type::DICTIONARY);
base::Value money(base::Value::Type::DICT);
const cart_db::MoneyProto& money_proto =
rule_discount_info_proto.amount_off();
@ -139,7 +139,7 @@ std::string CartDiscountLinkFetcher::GeneratePostData(
}
discount_dict.SetKey("ruleDiscounts", std::move(rule_discounts_list));
base::Value request_dict(base::Value::Type::DICTIONARY);
base::Value request_dict(base::Value::Type::DICT);
request_dict.SetKey("discount", std::move(discount_dict));
request_dict.SetStringKey("baseUrl", cart_content_proto.merchant_cart_url());
request_dict.SetStringKey("merchantId", cart_discount_proto.merchant_id());

@ -187,7 +187,7 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) {
&provider, google_url, google_url,
ContentSettingsType::AUTO_SELECT_CERTIFICATE, false);
ASSERT_EQ(base::Value::Type::DICTIONARY, cert_filter_setting.type());
ASSERT_EQ(base::Value::Type::DICT, cert_filter_setting.type());
base::Value::List* cert_filters =
cert_filter_setting.GetDict().FindList("filters");
ASSERT_TRUE(cert_filters);

@ -400,7 +400,7 @@ TEST_F(PrefProviderTest, Deadlock) {
ScopedDictPrefUpdate update(&prefs, info->pref_name());
base::Value::Dict& mutable_settings = update.Get();
mutable_settings.Set("www.example.com,*",
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
}
EXPECT_TRUE(observer.notification_received());

@ -1468,8 +1468,7 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) {
CONTENT_SETTING_BLOCK);
host_content_settings_map->SetWebsiteSettingCustomScope(
pattern2, ContentSettingsPattern::Wildcard(),
ContentSettingsType::APP_BANNER,
base::Value(base::Value::Type::DICTIONARY));
ContentSettingsType::APP_BANNER, base::Value(base::Value::Type::DICT));
// First, test that we clear only COOKIES (not APP_BANNER), and pattern2.
host_content_settings_map->ClearSettingsForOneTypeWithPredicate(
@ -1499,14 +1498,14 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) {
// Add settings.
host_content_settings_map->SetWebsiteSettingDefaultScope(
url1, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
// This setting should override the one above, as it's the same origin.
host_content_settings_map->SetWebsiteSettingDefaultScope(
url2, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
host_content_settings_map->SetWebsiteSettingDefaultScope(
url3, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
base::Value(base::Value::Type::DICTIONARY));
base::Value(base::Value::Type::DICT));
// Verify we only have two.
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::SITE_ENGAGEMENT, &host_settings);

@ -105,7 +105,7 @@ static bool ParseResponse(const std::string& json,
static std::string SerializeCommand(int command_id,
const std::string& method,
base::Value params) {
base::Value command(base::Value::Type::DICTIONARY);
base::Value command(base::Value::Type::DICT);
command.SetIntKey(kIdParam, command_id);
command.SetStringKey(kMethodParam, method);
command.SetKey(kParamsParam, std::move(params));
@ -493,7 +493,7 @@ void PortForwardingController::Connection::SerializeChanges(
void PortForwardingController::Connection::SendCommand(
const std::string& method, int port) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Value params(base::Value::Type::DICTIONARY);
base::Value params(base::Value::Type::DICT);
DCHECK(method == kBindMethod || kUnbindMethod == method);
params.SetIntKey(kPortParam, port);
int id = ++command_id_;

@ -322,7 +322,7 @@ bool DevToolsEventForwarder::ForwardEvent(
if (whitelisted_keys_.find(key) == whitelisted_keys_.end())
return false;
base::Value event_data(base::Value::Type::DICTIONARY);
base::Value event_data(base::Value::Type::DICT);
event_data.SetStringKey("type", event_type);
event_data.SetStringKey("key", ui::KeycodeConverter::DomKeyToKeyString(
static_cast<ui::DomKey>(event.dom_key)));

@ -19,7 +19,7 @@ namespace {
HostDescriptionNode GetNodeWithLabel(const char* name, int label) {
HostDescriptionNode node = {name, std::string(),
base::Value(base::Value::Type::DICTIONARY)};
base::Value(base::Value::Type::DICT)};
node.representation.SetIntKey("label", label);
return node;
}

@ -469,7 +469,7 @@ void ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites(
origin, origin, ContentSettingsType::IMPORTANT_SITE_INFO, nullptr);
if (!dict.is_dict())
dict = base::Value(base::Value::Type::DICTIONARY);
dict = base::Value(base::Value::Type::DICT);
RecordIgnore(dict.GetDict());
@ -487,7 +487,7 @@ void ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites(
// We clear our ignore counter for sites that the user chose.
for (const std::string& excluded_site : excluded_sites) {
GURL origin("http://" + excluded_site);
base::Value dict(base::Value::Type::DICTIONARY);
base::Value dict(base::Value::Type::DICT);
dict.SetIntKey(kNumTimesIgnoredName, 0);
dict.RemoveKey(kTimeLastIgnored);
map->SetWebsiteSettingDefaultScope(origin, origin,

@ -18,12 +18,12 @@ namespace enterprise_connectors {
std::string ProtobufChallengeToJsonChallenge(
const std::string& challenge_response) {
base::Value signed_data(base::Value::Type::DICTIONARY);
base::Value signed_data(base::Value::Type::DICT);
std::string encoded;
base::Base64Encode(challenge_response, &encoded);
base::Value dict(base::Value::Type::DICTIONARY);
base::Value dict(base::Value::Type::DICT);
dict.SetKey("challengeResponse", base::Value(encoded));
std::string json;

@ -154,7 +154,7 @@ bool LinuxKeyPersistenceDelegate::StoreKeyPair(
}
// Storing key and trust level information.
base::Value keyinfo(base::Value::Type::DICTIONARY);
base::Value keyinfo(base::Value::Type::DICT);
const std::string encoded_key = base::Base64Encode(wrapped);
keyinfo.SetKey(kSigningKeyName, base::Value(encoded_key));
keyinfo.SetKey(kSigningKeyTrustLevel, base::Value(trust_level));

@ -92,9 +92,9 @@ class ExtensionRequestObserverTest : public BrowserWithTestWindowTest {
// Creates fake pending request in pref.
void SetPendingList(const std::vector<std::string>& ids) {
std::unique_ptr<base::Value> id_values =
std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
std::make_unique<base::Value>(base::Value::Type::DICT);
for (const auto& id : ids) {
base::Value request_data(base::Value::Type::DICTIONARY);
base::Value request_data(base::Value::Type::DICT);
request_data.SetKey(extension_misc::kExtensionRequestTimestamp,
::base::TimeToValue(base::Time::Now()));
id_values->SetKey(id, std::move(request_data));

@ -110,9 +110,9 @@ class ExtensionRequestReportGeneratorTest : public ::testing::Test {
const std::string& timestamp_name,
TestingProfile* profile) {
std::unique_ptr<base::Value> id_values =
std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
std::make_unique<base::Value>(base::Value::Type::DICT);
for (const auto& id : ids) {
base::Value request_data(base::Value::Type::DICTIONARY);
base::Value request_data(base::Value::Type::DICT);
request_data.SetKey(
timestamp_name,
::base::TimeToValue(base::Time::FromJavaTime(kTimeStamp)));

@ -138,9 +138,9 @@ class ProfileReportGeneratorTest : public ::testing::Test {
#if !BUILDFLAG(IS_ANDROID)
void SetExtensionToPendingList(const std::vector<std::string>& ids) {
std::unique_ptr<base::Value> id_values =
std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
std::make_unique<base::Value>(base::Value::Type::DICT);
for (const auto& id : ids) {
base::Value request_data(base::Value::Type::DICTIONARY);
base::Value request_data(base::Value::Type::DICT);
request_data.SetKey(
extension_misc::kExtensionRequestTimestamp,
::base::TimeToValue(base::Time::FromJavaTime(kFakeTime)));

@ -42,7 +42,7 @@ TEST_F(RealTimeReportGeneratorTest, ExtensionRequest) {
std::make_unique<base::Value>(true));
std::unique_ptr<base::Value> requests =
std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
std::make_unique<base::Value>(base::Value::Type::DICT);
requests->SetKey(extension_id, base::Value());
profile->GetTestingPrefService()->SetUserPref(
prefs::kCloudExtensionRequestIds, std::move(requests));

@ -94,15 +94,15 @@ class ClientCertificateFetcherTest : public testing::Test {
const std::string& subject) {
EXPECT_FALSE(issuer.empty() && subject.empty());
base::Value filter(base::Value::Type::DICTIONARY);
base::Value filter(base::Value::Type::DICT);
if (!issuer.empty()) {
base::Value issuer_value(base::Value::Type::DICTIONARY);
base::Value issuer_value(base::Value::Type::DICT);
issuer_value.SetStringKey("CN", issuer);
filter.SetKey("ISSUER", std::move(issuer_value));
}
if (!subject.empty()) {
base::Value subject_value(base::Value::Type::DICTIONARY);
base::Value subject_value(base::Value::Type::DICT);
subject_value.SetStringKey("CN", subject);
filter.SetKey("SUBJECT", std::move(subject_value));
}

@ -137,15 +137,15 @@ class AutoSelectCertificateTest : public testing::Test {
const std::string& subject) {
EXPECT_FALSE(issuer.empty() && subject.empty());
base::Value filter(base::Value::Type::DICTIONARY);
base::Value filter(base::Value::Type::DICT);
if (!issuer.empty()) {
base::Value issuer_value(base::Value::Type::DICTIONARY);
base::Value issuer_value(base::Value::Type::DICT);
issuer_value.SetStringKey("CN", issuer);
filter.SetKey("ISSUER", std::move(issuer_value));
}
if (!subject.empty()) {
base::Value subject_value(base::Value::Type::DICTIONARY);
base::Value subject_value(base::Value::Type::DICT);
subject_value.SetStringKey("CN", subject);
filter.SetKey("SUBJECT", std::move(subject_value));
}

@ -212,7 +212,7 @@ bool CommandService::AddKeybindingPref(
RemoveKeybindingPrefs(extension_id, command_name);
// Set the keybinding pref.
base::Value keybinding(base::Value::Type::DICTIONARY);
base::Value keybinding(base::Value::Type::DICT);
keybinding.SetStringKey(kExtension, extension_id);
keybinding.SetStringKey(kCommandName, command_name);
keybinding.SetBoolKey(kGlobal, global);

@ -471,7 +471,7 @@ IN_PROC_BROWSER_TEST_F(CommandServiceTest,
// another platform.
std::string anotherPlatformKey = GetAnotherCommandPlatform() + ":Alt+G";
const char kNamedCommandName[] = "toggle-feature";
base::Value keybinding(base::Value::Type::DICTIONARY);
base::Value keybinding(base::Value::Type::DICT);
keybinding.SetStringKey("extension", extension->id());
keybinding.SetStringKey("command_name", kNamedCommandName);
keybinding.SetBoolKey("global", false);

@ -367,7 +367,7 @@ bool ExtensionActionFunction::ExtractDataFromArguments() {
tab_id_ = first_arg.GetInt();
break;
case base::Value::Type::DICTIONARY: {
case base::Value::Type::DICT: {
// Found the details argument.
details_ = &first_arg.GetDict();
// Still need to check for the tabId within details.

@ -383,7 +383,7 @@ TEST_F(ManagementApiUnitTest, ManagementUninstall) {
extensions::UNINSTALL_SOURCE_CHROME_EXTENSIONS_PAGE, 2);
// Try again, using showConfirmDialog: false.
base::Value options(base::Value::Type::DICTIONARY);
base::Value options(base::Value::Type::DICT);
options.SetBoolPath("showConfirmDialog", false);
uninstall_args.Append(std::move(options));
function = base::MakeRefCounted<ManagementUninstallFunction>();

@ -182,13 +182,13 @@ class TestNetworkingPrivateDelegate : public NetworkingPrivateDelegate {
}
void GetGlobalPolicy(GetGlobalPolicyCallback callback) override {
std::move(callback).Run(base::Value::ToUniquePtrValue(
base::Value(base::Value::Type::DICTIONARY)));
std::move(callback).Run(
base::Value::ToUniquePtrValue(base::Value(base::Value::Type::DICT)));
}
void GetCertificateLists(GetCertificateListsCallback callback) override {
std::move(callback).Run(base::Value::ToUniquePtrValue(
base::Value(base::Value::Type::DICTIONARY)));
std::move(callback).Run(
base::Value::ToUniquePtrValue(base::Value(base::Value::Type::DICT)));
}
// Synchronous methods
@ -220,7 +220,7 @@ class TestNetworkingPrivateDelegate : public NetworkingPrivateDelegate {
if (fail_) {
std::move(failure_callback).Run(kFailure);
} else {
base::Value result(base::Value::Type::DICTIONARY);
base::Value result(base::Value::Type::DICT);
result.SetStringPath(::onc::network_config::kGUID, guid);
result.SetStringPath(::onc::network_config::kType,
::onc::network_config::kWiFi);
@ -261,7 +261,7 @@ class TestNetworkingPrivateDelegate : public NetworkingPrivateDelegate {
std::move(callback).Run(absl::nullopt, kFailure);
return;
}
base::Value result(base::Value::Type::DICTIONARY);
base::Value result(base::Value::Type::DICT);
result.SetStringKey(::onc::network_config::kGUID, guid);
result.SetStringKey(::onc::network_config::kType,
::onc::network_config::kWiFi);

@ -235,7 +235,7 @@ void PageCaptureSaveAsMHTMLFunction::ReturnSuccess(int64_t file_size) {
ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(source_process_id(),
mhtml_path_);
base::Value response(base::Value::Type::DICTIONARY);
base::Value response(base::Value::Type::DICT);
response.SetStringKey("mhtmlFilePath", mhtml_path_.AsUTF8Unsafe());
response.SetIntKey("mhtmlFileLength", file_size);
response.SetIntKey("requestId", request_id());

@ -111,9 +111,9 @@ class PlatformKeysTest : public PlatformKeysTestBase {
// Set up the test policy that gives |extension_| the permission to access
// corporate keys.
base::Value key_permissions_policy(base::Value::Type::DICTIONARY);
base::Value key_permissions_policy(base::Value::Type::DICT);
{
base::Value cert1_key_permission(base::Value::Type::DICTIONARY);
base::Value cert1_key_permission(base::Value::Type::DICT);
cert1_key_permission.SetKey("allowCorporateKeyUsage", base::Value(true));
key_permissions_policy.SetKey(kExtensionId,
std::move(cert1_key_permission));

@ -661,7 +661,7 @@ ExtensionFunction::ResponseAction GetPreferenceFunction::Run() {
extensions::preference_helpers::GetLevelOfControl(
profile, extension_id(), browser_pref, incognito);
base::Value result(base::Value::Type::DICTIONARY);
base::Value result(base::Value::Type::DICT);
ProduceGetResult(&result, pref->GetValue(), level_of_control, browser_pref,
incognito);
@ -724,7 +724,7 @@ void GetPreferenceFunction::OnLacrosGetSuccess(
control_state, profile, extension_id(), cached_browser_pref_,
incognito);
base::Value result(base::Value::Type::DICTIONARY);
base::Value result(base::Value::Type::DICT);
ProduceGetResult(&result, pref_value, level_of_control, cached_browser_pref_,
incognito);

@ -117,7 +117,7 @@ class PrinterProviderApiTest : public ExtensionApiTest,
PrinterProviderAPI::PrintCallback callback) {
PrinterProviderPrintJob job;
job.printer_id = extension_id + ":printer_id";
job.ticket = base::Value(base::Value::Type::DICTIONARY);
job.ticket = base::Value(base::Value::Type::DICT);
job.content_type = "application/pdf";
PrinterProviderAPIFactory::GetInstance()
@ -131,7 +131,7 @@ class PrinterProviderApiTest : public ExtensionApiTest,
PrinterProviderPrintJob job;
job.printer_id = extension_id + ":printer_id";
job.job_title = u"Print job";
job.ticket = base::Value(base::Value::Type::DICTIONARY);
job.ticket = base::Value(base::Value::Type::DICT);
job.content_type = "application/pdf";
const unsigned char kDocumentBytes[] = {'b', 'y', 't', 'e', 's'};
job.document_bytes =

@ -1053,7 +1053,7 @@ settings_api::PrefType PrefsUtil::GetType(const std::string& name,
: settings_api::PrefType::PREF_TYPE_STRING;
case base::Value::Type::LIST:
return settings_api::PrefType::PREF_TYPE_LIST;
case base::Value::Type::DICTIONARY:
case base::Value::Type::DICT:
return settings_api::PrefType::PREF_TYPE_DICTIONARY;
default:
return settings_api::PrefType::PREF_TYPE_NONE;
@ -1237,7 +1237,7 @@ settings_private::SetPrefResult PrefsUtil::SetPref(const std::string& pref_name,
switch (pref->GetType()) {
case base::Value::Type::BOOLEAN:
case base::Value::Type::LIST:
case base::Value::Type::DICTIONARY:
case base::Value::Type::DICT:
pref_service->Set(pref_name, *value);
break;
case base::Value::Type::DOUBLE:

@ -656,7 +656,7 @@ IN_PROC_BROWSER_TEST_P(ExtensionSettingsManagedStorageApiTest,
ASSERT_TRUE(schema);
ASSERT_TRUE(schema->valid());
ASSERT_EQ(base::Value::Type::DICTIONARY, schema->type());
ASSERT_EQ(base::Value::Type::DICT, schema->type());
ASSERT_TRUE(schema->GetKnownProperty("string-policy").valid());
EXPECT_EQ(base::Value::Type::STRING,
schema->GetKnownProperty("string-policy").type());
@ -684,13 +684,13 @@ IN_PROC_BROWSER_TEST_P(ExtensionSettingsManagedStorageApiTest,
policy::Schema dict = schema->GetKnownProperty("dict-policy");
ASSERT_TRUE(dict.valid());
ASSERT_EQ(base::Value::Type::DICTIONARY, dict.type());
ASSERT_EQ(base::Value::Type::DICT, dict.type());
list = dict.GetKnownProperty("list");
ASSERT_TRUE(list.valid());
ASSERT_EQ(base::Value::Type::LIST, list.type());
dict = list.GetItems();
ASSERT_TRUE(dict.valid());
ASSERT_EQ(base::Value::Type::DICTIONARY, dict.type());
ASSERT_EQ(base::Value::Type::DICT, dict.type());
ASSERT_TRUE(dict.GetProperty("anything").valid());
EXPECT_EQ(base::Value::Type::INTEGER, dict.GetProperty("anything").type());
}

@ -274,7 +274,7 @@ TEST_F(TabGroupsApiUnitTest, TabGroupsQueryColor) {
ASSERT_EQ(1u, groups_list.size());
const base::Value& group_info = groups_list[0];
ASSERT_EQ(base::Value::Type::DICTIONARY, group_info.type());
ASSERT_EQ(base::Value::Type::DICT, group_info.type());
EXPECT_EQ(
tab_groups_util::GetGroupId(group3),
group_info.FindKeyOfType("id", base::Value::Type::INTEGER)->GetInt());

@ -784,7 +784,7 @@ ExtensionFunction::ResponseAction TerminalPrivateSetPrefsFunction::Run() {
static const base::NoDestructor<
base::flat_map<std::string, base::Value::Type>>
kAllowList{{{guest_os::prefs::kGuestOsTerminalSettings,
base::Value::Type::DICTIONARY}}};
base::Value::Type::DICT}}};
for (const auto item : params->prefs.additional_properties) {
// Write prefs if they are allowed, and match expected type, else ignore.

@ -80,9 +80,9 @@ class ExtensionInstallStatusTest : public BrowserWithTestWindowTest {
void SetPendingList(const std::vector<ExtensionId>& ids) {
std::unique_ptr<base::Value> id_values =
std::make_unique<base::Value>(base::Value::Type::DICTIONARY);
std::make_unique<base::Value>(base::Value::Type::DICT);
for (const auto& id : ids) {
base::Value request_data(base::Value::Type::DICTIONARY);
base::Value request_data(base::Value::Type::DICT);
request_data.SetKey(extension_misc::kExtensionRequestTimestamp,
::base::TimeToValue(base::Time::Now()));
id_values->SetKey(id, std::move(request_data));

@ -345,7 +345,7 @@ ExtensionInstallStatus AddExtensionToPendingList(
ScopedDictPrefUpdate pending_requests_update(
profile->GetPrefs(), prefs::kCloudExtensionRequestIds);
DCHECK(!pending_requests_update->Find(id));
base::Value request_data(base::Value::Type::DICTIONARY);
base::Value request_data(base::Value::Type::DICT);
request_data.SetKey(extension_misc::kExtensionRequestTimestamp,
::base::TimeToValue(base::Time::Now()));
if (!justification.empty()) {

@ -58,7 +58,7 @@ class BlocklistStatesInteractionUnitTest : public ExtensionServiceTestBase {
void SetOmahaBlocklistStateForExtension(const std::string& extension_id,
const std::string& omaha_attribute,
bool value) {
base::Value attributes(base::Value::Type::DICTIONARY);
base::Value attributes(base::Value::Type::DICT);
attributes.SetBoolKey(omaha_attribute, value);
service()->PerformActionBasedOnOmahaAttributes(extension_id, attributes);
}

@ -103,7 +103,7 @@ std::string CreateFetchScript(
return content::JsReplace(kFetchScriptTemplate, resource,
request_init
? std::move(*request_init)
: base::Value(base::Value::Type::DICTIONARY));
: base::Value(base::Value::Type::DICT));
}
std::string PopString(content::DOMMessageQueue* message_queue) {
@ -1315,7 +1315,7 @@ IN_PROC_BROWSER_TEST_F(
{
content::DOMMessageQueue message_queue(active_web_contents());
base::Value request_init(base::Value::Type::DICTIONARY);
base::Value request_init(base::Value::Type::DICT);
request_init.SetStringPath("trustToken.type", "token-redemption");
EXPECT_TRUE(ExecuteContentScript(
@ -1338,7 +1338,7 @@ IN_PROC_BROWSER_TEST_F(
{
content::DOMMessageQueue message_queue(active_web_contents());
base::Value request_init(base::Value::Type::DICTIONARY);
base::Value request_init(base::Value::Type::DICT);
request_init.SetStringPath("trustToken.type", "token-redemption");
EXPECT_TRUE(ExecuteContentScript(
@ -1524,7 +1524,7 @@ IN_PROC_BROWSER_TEST_F(CorbAndCorsExtensionBrowserTest,
// Performs a cross-origin fetch from the background page in "no-cors" mode.
GURL cross_site_resource(
embedded_test_server()->GetURL("cross-site.com", "/nosniff.xml"));
base::Value request_init(base::Value::Type::DICTIONARY);
base::Value request_init(base::Value::Type::DICT);
request_init.SetStringPath("mode", "no-cors");
std::string script =
CreateFetchScript(cross_site_resource, std::move(request_init));
@ -1653,7 +1653,7 @@ IN_PROC_BROWSER_TEST_F(CorbAndCorsExtensionBrowserTest,
GURL cross_site_resource2(
embedded_test_server()->GetURL("cross-site.com", "/nosniff.xml"));
base::Value request_init(base::Value::Type::DICTIONARY);
base::Value request_init(base::Value::Type::DICT);
request_init.SetStringPath("method", "GET");
request_init.SetStringPath("mode", "no-cors");

@ -66,7 +66,7 @@ class ExtensionAllowlistUnitTestBase : public ExtensionServiceTestBase {
void PerformActionBasedOnOmahaAttributes(const std::string& extension_id,
bool is_malware,
bool is_allowlisted) {
base::Value attributes(base::Value::Type::DICTIONARY);
base::Value attributes(base::Value::Type::DICT);
if (is_malware)
attributes.SetBoolKey("_malware", true);
@ -465,7 +465,7 @@ TEST_F(ExtensionAllowlistUnitTest, MissingAttributeAreIgnored) {
extension_prefs()->GetDisableReasons(kExtensionId2));
// Simulate an update check with no custom attribute defined.
base::Value attributes(base::Value::Type::DICTIONARY);
base::Value attributes(base::Value::Type::DICT);
service()->PerformActionBasedOnOmahaAttributes(kExtensionId1, attributes);
service()->PerformActionBasedOnOmahaAttributes(kExtensionId2, attributes);

@ -391,7 +391,7 @@ void ExtensionAssetsManagerChromeOS::InstallSharedExtensionDone(
base::Value::Dict* extension_info_weak = shared_extensions->EnsureDict(id);
CHECK(!shared_extensions->Find(version));
base::Value version_info(base::Value::Type::DICTIONARY);
base::Value version_info(base::Value::Type::DICT);
version_info.SetStringKey(kSharedExtensionPath, shared_version_dir.value());
base::Value users(base::Value::Type::LIST);

@ -99,7 +99,7 @@ class ExtensionGarbageCollectorChromeOSUnitTest
base::Value::Dict* extension_info_weak = shared_extensions->EnsureDict(id);
base::Value version_info(base::Value::Type::DICTIONARY);
base::Value version_info(base::Value::Type::DICT);
version_info.SetStringKey(
ExtensionAssetsManagerChromeOS::kSharedExtensionPath, path.value());

@ -744,7 +744,7 @@ const base::Value::Dict* ExtensionManagement::LoadDictPreference(
const char* pref_name,
bool force_managed) const {
const base::Value* value =
LoadPreference(pref_name, force_managed, base::Value::Type::DICTIONARY);
LoadPreference(pref_name, force_managed, base::Value::Type::DICT);
return value ? &value->GetDict() : nullptr;
}

@ -3530,7 +3530,7 @@ TEST_F(ExtensionServiceTest, NoUnsetBlocklistInPrefs) {
EXPECT_TRUE(registry()->enabled_extensions().Contains(good0));
EXPECT_FALSE(registry()->blocklisted_extensions().Contains(good0));
base::Value attributes(base::Value::Type::DICTIONARY);
base::Value attributes(base::Value::Type::DICT);
attributes.SetKey("_malware", base::Value(true));
ExtensionPrefs* prefs = ExtensionPrefs::Get(profile());
@ -4750,7 +4750,7 @@ TEST_F(ExtensionServiceTest, DisableRemotelyForMalware) {
InstallCRX(data_dir().AppendASCII("good.crx"), INSTALL_NEW);
EXPECT_TRUE(registry()->enabled_extensions().GetByID(good_crx));
base::Value attributes(base::Value::Type::DICTIONARY);
base::Value attributes(base::Value::Type::DICT);
attributes.SetKey("_malware", base::Value(true));
EXPECT_EQ(1u, registry()->enabled_extensions().size());
@ -4775,7 +4775,7 @@ TEST_F(ExtensionServiceTest, NoEnableRemotelyDisabledExtension) {
InstallCRX(data_dir().AppendASCII("good.crx"), INSTALL_NEW);
EXPECT_TRUE(registry()->enabled_extensions().GetByID(good_crx));
base::Value attributes(base::Value::Type::DICTIONARY);
base::Value attributes(base::Value::Type::DICT);
attributes.SetKey("_malware", base::Value(true));
ExtensionPrefs* prefs = ExtensionPrefs::Get(profile());
service()->DisableExtension(good_crx, disable_reason::DISABLE_USER_ACTION);

Some files were not shown because too many files have changed in this diff Show More