[Code Health] Replace remaining base.Value.SetIntKey with dict Set
Bug: 1303949 Change-Id: I80555fcda6c17d01fb69d3cff4aa126b78a60f7b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4508954 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Nick Harper <nharper@chromium.org> Reviewed-by: Sean Topping <seantopping@chromium.org> Commit-Queue: Sergii Bykov <sbykov@google.com> Cr-Commit-Position: refs/heads/main@{#1140496}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
611c9e76b3
commit
92a1429435
ash/projector
base
chrome
browser
apps
app_service
ash
devtools
engagement
usb
web_applications
credential_provider
chromecast/base
net/docs
@ -5,10 +5,6 @@
|
||||
#include "ash/projector/projector_metadata_model.h"
|
||||
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "media/mojo/mojom/speech_recognition.mojom.h"
|
||||
|
||||
namespace ash {
|
||||
namespace {
|
||||
@ -65,11 +61,12 @@ ProjectorKeyIdea::~ProjectorKeyIdea() = default;
|
||||
// "startOffset": INT
|
||||
// "endOffset": INT
|
||||
// "text": STRING
|
||||
base::Value ProjectorKeyIdea::ToJson() {
|
||||
base::Value transcript(base::Value::Type::DICT);
|
||||
transcript.SetIntKey(kStartOffsetKey, start_time_.InMilliseconds());
|
||||
transcript.SetIntKey(kEndOffsetKey, end_time_.InMilliseconds());
|
||||
transcript.SetStringKey(kTextKey, text_);
|
||||
base::Value::Dict ProjectorKeyIdea::ToJson() {
|
||||
auto transcript =
|
||||
base::Value::Dict()
|
||||
.Set(kStartOffsetKey, static_cast<int>(start_time_.InMilliseconds()))
|
||||
.Set(kEndOffsetKey, static_cast<int>(end_time_.InMilliseconds()))
|
||||
.Set(kTextKey, text_);
|
||||
return transcript;
|
||||
}
|
||||
|
||||
@ -108,7 +105,7 @@ ProjectorTranscript::~ProjectorTranscript() = default;
|
||||
// "text": STRING
|
||||
// "hypothesisParts": DICT LIST
|
||||
//
|
||||
base::Value ProjectorTranscript::ToJson() {
|
||||
base::Value::Dict ProjectorTranscript::ToJson() {
|
||||
base::Value::Dict transcript;
|
||||
transcript.Set(kStartOffsetKey,
|
||||
static_cast<int>(start_time_.InMilliseconds()));
|
||||
@ -120,7 +117,7 @@ base::Value ProjectorTranscript::ToJson() {
|
||||
hypothesis_parts_list.Append(HypothesisPartsToDict(hypothesis_part));
|
||||
|
||||
transcript.Set(kHypothesisPartsKey, std::move(hypothesis_parts_list));
|
||||
return base::Value(std::move(transcript));
|
||||
return transcript;
|
||||
}
|
||||
|
||||
ProjectorMetadata::ProjectorMetadata() = default;
|
||||
@ -192,7 +189,7 @@ std::string ProjectorMetadata::Serialize() {
|
||||
// "captionLanguage": STRING
|
||||
// "tableOfContent": LIST
|
||||
// "recognitionStatus": INTEGER
|
||||
base::Value ProjectorMetadata::ToJson() {
|
||||
base::Value::Dict ProjectorMetadata::ToJson() {
|
||||
base::Value::Dict metadata;
|
||||
metadata.Set(kCaptionLanguage, caption_language_);
|
||||
|
||||
@ -207,7 +204,7 @@ base::Value ProjectorMetadata::ToJson() {
|
||||
metadata.Set(kKeyIdeasKey, std::move(key_ideas_list));
|
||||
metadata.Set(kRecognitionStatus,
|
||||
static_cast<int>(speech_recognition_status_));
|
||||
return base::Value(std::move(metadata));
|
||||
return metadata;
|
||||
}
|
||||
|
||||
} // namespace ash
|
||||
|
@ -11,11 +11,8 @@
|
||||
|
||||
#include "ash/ash_export.h"
|
||||
#include "base/time/time.h"
|
||||
#include "media/mojo/mojom/speech_recognition.mojom.h"
|
||||
|
||||
namespace base {
|
||||
class Value;
|
||||
} // namespace base
|
||||
#include "base/values.h"
|
||||
#include "media/mojo/mojom/speech_recognition_result.h"
|
||||
|
||||
namespace ash {
|
||||
|
||||
@ -46,7 +43,7 @@ class MetadataItem {
|
||||
base::TimeDelta& end_time() { return end_time_; }
|
||||
|
||||
// Return the serialized metadata item. This is used for storage.
|
||||
virtual base::Value ToJson() = 0;
|
||||
virtual base::Value::Dict ToJson() = 0;
|
||||
|
||||
protected:
|
||||
// The start time of the metadata item from the start of the recording
|
||||
@ -68,7 +65,7 @@ class ASH_EXPORT ProjectorKeyIdea : public MetadataItem {
|
||||
ProjectorKeyIdea& operator=(const ProjectorKeyIdea&) = delete;
|
||||
~ProjectorKeyIdea() override;
|
||||
|
||||
base::Value ToJson() override;
|
||||
base::Value::Dict ToJson() override;
|
||||
};
|
||||
|
||||
// Class to describe a transcription.
|
||||
@ -83,7 +80,7 @@ class ASH_EXPORT ProjectorTranscript : public MetadataItem {
|
||||
ProjectorTranscript& operator=(const ProjectorTranscript&) = delete;
|
||||
~ProjectorTranscript() override;
|
||||
|
||||
base::Value ToJson() override;
|
||||
base::Value::Dict ToJson() override;
|
||||
|
||||
private:
|
||||
std::vector<media::HypothesisParts> hypothesis_parts_;
|
||||
@ -114,7 +111,7 @@ class ASH_EXPORT ProjectorMetadata {
|
||||
size_t GetTranscriptsCount() const { return transcripts_.size(); }
|
||||
|
||||
private:
|
||||
base::Value ToJson();
|
||||
base::Value::Dict ToJson();
|
||||
|
||||
std::vector<std::unique_ptr<ProjectorTranscript>> transcripts_;
|
||||
std::vector<std::unique_ptr<ProjectorKeyIdea>> key_ideas_;
|
||||
|
@ -1173,10 +1173,6 @@ Value* Value::SetKey(StringPiece key, Value&& value) {
|
||||
return GetDict().Set(key, std::move(value));
|
||||
}
|
||||
|
||||
Value* Value::SetIntKey(StringPiece key, int value) {
|
||||
return GetDict().Set(key, value);
|
||||
}
|
||||
|
||||
Value* Value::SetStringKey(StringPiece key, StringPiece value) {
|
||||
return GetDict().Set(key, value);
|
||||
}
|
||||
|
@ -785,8 +785,6 @@ class BASE_EXPORT GSL_OWNER Value {
|
||||
// ambiguities in the value type.
|
||||
//
|
||||
// DEPRECATED: Prefer `Value::Dict::Set()`.
|
||||
Value* SetIntKey(StringPiece key, int val);
|
||||
// DEPRECATED: Prefer `Value::Dict::Set()`.
|
||||
Value* SetStringKey(StringPiece key, StringPiece val);
|
||||
// DEPRECATED: Prefer `Value::Dict::Set()`.
|
||||
Value* SetStringKey(StringPiece key, StringPiece16 val);
|
||||
|
@ -89,16 +89,16 @@ std::string GetInputEventSourceKey(InputEventSource event_source) {
|
||||
}
|
||||
}
|
||||
|
||||
base::Value ConvertEventCountsToValue(
|
||||
base::Value::Dict ConvertEventCountsToValue(
|
||||
const AppPlatformInputMetrics::EventSourceToCounts& event_counts) {
|
||||
base::Value event_counts_dict(base::Value::Type::DICT);
|
||||
base::Value::Dict event_counts_dict;
|
||||
for (const auto& counts : event_counts) {
|
||||
base::Value count_dict(base::Value::Type::DICT);
|
||||
base::Value::Dict count_dict;
|
||||
for (const auto& it : counts.second) {
|
||||
count_dict.SetIntKey(GetAppTypeHistogramName(it.first), it.second);
|
||||
count_dict.Set(GetAppTypeHistogramName(it.first), it.second);
|
||||
}
|
||||
event_counts_dict.SetKey(GetInputEventSourceKey(counts.first),
|
||||
std::move(count_dict));
|
||||
event_counts_dict.Set(GetInputEventSourceKey(counts.first),
|
||||
std::move(count_dict));
|
||||
}
|
||||
return event_counts_dict;
|
||||
}
|
||||
|
@ -33,20 +33,31 @@ TEST_F(GuestIdTest, GuestIdEquality) {
|
||||
}
|
||||
|
||||
TEST_F(GuestIdTest, GuestIdFromDictValue) {
|
||||
base::Value dict(base::Value::Type::DICT);
|
||||
dict.SetStringKey(prefs::kVmNameKey, "foo");
|
||||
dict.SetStringKey(prefs::kContainerNameKey, "bar");
|
||||
EXPECT_TRUE(GuestId(dict) == GuestId(VmType::TERMINA, "foo", "bar"));
|
||||
{
|
||||
auto dict = base::Value::Dict()
|
||||
.Set(prefs::kVmNameKey, "foo")
|
||||
.Set(prefs::kContainerNameKey, "bar");
|
||||
EXPECT_TRUE(GuestId(base::Value(std::move(dict))) ==
|
||||
GuestId(VmType::TERMINA, "foo", "bar"));
|
||||
}
|
||||
|
||||
dict.SetIntKey(prefs::kVmTypeKey, 0);
|
||||
dict.SetStringKey(prefs::kVmNameKey, "foo");
|
||||
dict.SetStringKey(prefs::kContainerNameKey, "bar");
|
||||
EXPECT_TRUE(GuestId(dict) == GuestId(VmType::TERMINA, "foo", "bar"));
|
||||
{
|
||||
auto dict = base::Value::Dict()
|
||||
.Set(prefs::kVmTypeKey, 0)
|
||||
.Set(prefs::kVmNameKey, "foo")
|
||||
.Set(prefs::kContainerNameKey, "bar");
|
||||
EXPECT_TRUE(GuestId(base::Value(std::move(dict))) ==
|
||||
GuestId(VmType::TERMINA, "foo", "bar"));
|
||||
}
|
||||
|
||||
dict.SetIntKey(prefs::kVmTypeKey, 1);
|
||||
dict.SetStringKey(prefs::kVmNameKey, "foo");
|
||||
dict.SetStringKey(prefs::kContainerNameKey, "bar");
|
||||
EXPECT_TRUE(GuestId(dict) == GuestId(VmType::PLUGIN_VM, "foo", "bar"));
|
||||
{
|
||||
auto dict = base::Value::Dict()
|
||||
.Set(prefs::kVmTypeKey, 1)
|
||||
.Set(prefs::kVmNameKey, "foo")
|
||||
.Set(prefs::kContainerNameKey, "bar");
|
||||
EXPECT_TRUE(GuestId(base::Value(std::move(dict))) ==
|
||||
GuestId(VmType::PLUGIN_VM, "foo", "bar"));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(GuestIdTest, GuestIdFromNonDictValue) {
|
||||
|
@ -9,10 +9,9 @@
|
||||
|
||||
namespace ash {
|
||||
|
||||
base::Value SystemWebAppData::AsDebugValue() const {
|
||||
base::Value root(base::Value::Type::DICT);
|
||||
root.SetIntKey("system_app_type", static_cast<int>(system_app_type));
|
||||
return root;
|
||||
base::Value::Dict SystemWebAppData::AsDebugValue() const {
|
||||
return base::Value::Dict().Set("system_app_type",
|
||||
static_cast<int>(system_app_type));
|
||||
}
|
||||
|
||||
bool operator==(const SystemWebAppData& chromeos_data1,
|
||||
|
@ -16,7 +16,7 @@ namespace ash {
|
||||
// System Web App during reinstall, i.e. before
|
||||
// `SystemWebAppManager::OnAppsSynchronized` is called.
|
||||
struct SystemWebAppData {
|
||||
base::Value AsDebugValue() const;
|
||||
base::Value::Dict AsDebugValue() const;
|
||||
|
||||
SystemWebAppType system_app_type;
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ namespace {
|
||||
HostDescriptionNode GetNodeWithLabel(const char* name, int label) {
|
||||
HostDescriptionNode node = {name, std::string(),
|
||||
base::Value(base::Value::Type::DICT)};
|
||||
node.representation.SetIntKey("label", label);
|
||||
node.representation.GetDict().Set("label", label);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -487,12 +487,12 @@ 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::DICT);
|
||||
dict.SetIntKey(kNumTimesIgnoredName, 0);
|
||||
dict.RemoveKey(kTimeLastIgnored);
|
||||
base::Value::Dict dict;
|
||||
dict.Set(kNumTimesIgnoredName, 0);
|
||||
dict.Remove(kTimeLastIgnored);
|
||||
map->SetWebsiteSettingDefaultScope(origin, origin,
|
||||
ContentSettingsType::IMPORTANT_SITE_INFO,
|
||||
std::move(dict));
|
||||
base::Value(std::move(dict)));
|
||||
}
|
||||
|
||||
// Finally, record our old crossed-stats.
|
||||
|
@ -152,11 +152,11 @@ TEST_F(UsbChooserContextTest, CheckGrantAndRevokePermission) {
|
||||
device_manager_.CreateAndAddDevice(0, 0, "Google", "Gizmo", "123ABC");
|
||||
UsbChooserContext* store = GetChooserContext(profile());
|
||||
|
||||
base::Value object(base::Value::Type::DICT);
|
||||
object.SetStringKey(kDeviceNameKey, "Gizmo");
|
||||
object.SetIntKey(kVendorIdKey, 0);
|
||||
object.SetIntKey(kProductIdKey, 0);
|
||||
object.SetStringKey(kSerialNumberKey, "123ABC");
|
||||
auto object = base::Value(base::Value::Dict()
|
||||
.Set(kDeviceNameKey, "Gizmo")
|
||||
.Set(kVendorIdKey, 0)
|
||||
.Set(kProductIdKey, 0)
|
||||
.Set(kSerialNumberKey, "123ABC"));
|
||||
|
||||
EXPECT_FALSE(store->HasDevicePermission(origin, *device_info));
|
||||
EXPECT_CALL(*mock_permission_observers_[profile()],
|
||||
@ -205,11 +205,12 @@ TEST_F(UsbChooserContextTest, CheckGrantAndRevokeEphemeralPermission) {
|
||||
|
||||
UsbChooserContext* store = GetChooserContext(profile());
|
||||
|
||||
base::Value object(base::Value::Type::DICT);
|
||||
object.SetStringKey(kDeviceNameKey, "Gizmo");
|
||||
object.SetStringKey(kGuidKey, device_info->guid);
|
||||
object.SetIntKey(kVendorIdKey, device_info->vendor_id);
|
||||
object.SetIntKey(kProductIdKey, device_info->product_id);
|
||||
auto object = base::Value(
|
||||
base::Value::Dict()
|
||||
.Set(kDeviceNameKey, "Gizmo")
|
||||
.Set(kGuidKey, device_info->guid)
|
||||
.Set(kVendorIdKey, static_cast<int>(device_info->vendor_id))
|
||||
.Set(kProductIdKey, static_cast<int>(device_info->product_id)));
|
||||
|
||||
EXPECT_FALSE(store->HasDevicePermission(origin, *device_info));
|
||||
EXPECT_CALL(*mock_permission_observers_[profile()],
|
||||
@ -726,7 +727,7 @@ class DeviceLoginScreenWebUsbChooserContextTest : public UsbChooserContextTest {
|
||||
builder.SetPath(base::FilePath(FILE_PATH_LITERAL(chrome::kInitialProfile)));
|
||||
signin_profile_ = builder.Build();
|
||||
}
|
||||
~DeviceLoginScreenWebUsbChooserContextTest() override {}
|
||||
~DeviceLoginScreenWebUsbChooserContextTest() override = default;
|
||||
|
||||
protected:
|
||||
Profile* GetSigninProfile() { return signin_profile_.get(); }
|
||||
|
@ -637,7 +637,7 @@ base::Value WebApp::ClientData::AsDebugValue() const {
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
root.Set("system_web_app_data", system_web_app_data
|
||||
? system_web_app_data->AsDebugValue()
|
||||
: base::Value());
|
||||
: base::Value::Dict());
|
||||
#endif
|
||||
return base::Value(std::move(root));
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/credential_provider/gaiacp/event_logging_api_manager.h"
|
||||
#include "chrome/credential_provider/gaiacp/gcp_utils.h"
|
||||
#include "chrome/credential_provider/gaiacp/gcpw_strings.h"
|
||||
@ -428,8 +429,7 @@ HRESULT EventLogsUploadManager::UploadEventViewerLogs(
|
||||
|
||||
chunk_id = std::max(chunk_id, log_entry.event_id);
|
||||
|
||||
base::Value log_entry_value(base::Value::Type::DICT);
|
||||
log_entry.ToValue(log_entry_value);
|
||||
base::Value::Dict log_entry_value = log_entry.ToValue();
|
||||
|
||||
// Get the JSON for the log to keep track of payload size.
|
||||
std::string log_entry_json;
|
||||
@ -517,16 +517,18 @@ HRESULT EventLogsUploadManager::MakeUploadLogChunkRequest(
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void EventLogsUploadManager::EventLogEntry::ToValue(base::Value& dict) const {
|
||||
base::Value timestamp(base::Value::Type::DICT);
|
||||
timestamp.SetIntKey(kEventLogTimeStampSecondsParameterName,
|
||||
created_ts.seconds);
|
||||
timestamp.SetIntKey(kEventLogTimeStampNanosParameterName, created_ts.nanos);
|
||||
|
||||
dict.SetStringKey(kEventLogDataParameterName, base::WideToUTF8(data));
|
||||
dict.SetIntKey(kEventLogEventIdParameterName, event_id);
|
||||
dict.SetIntKey(kEventLogSeverityLevelParameterName, severity_level);
|
||||
dict.SetKey(kEventLogTimeStampParameterName, std::move(timestamp));
|
||||
base::Value::Dict EventLogsUploadManager::EventLogEntry::ToValue() const {
|
||||
return base::Value::Dict()
|
||||
.Set(kEventLogDataParameterName, base::WideToUTF8(data))
|
||||
.Set(kEventLogEventIdParameterName, static_cast<int>(event_id))
|
||||
.Set(kEventLogSeverityLevelParameterName,
|
||||
static_cast<int>(severity_level))
|
||||
.Set(kEventLogTimeStampParameterName,
|
||||
base::Value::Dict()
|
||||
.Set(kEventLogTimeStampSecondsParameterName,
|
||||
static_cast<int>(created_ts.seconds))
|
||||
.Set(kEventLogTimeStampNanosParameterName,
|
||||
static_cast<int>(created_ts.nanos)));
|
||||
}
|
||||
|
||||
} // namespace credential_provider
|
||||
|
@ -58,7 +58,7 @@ class EventLogsUploadManager {
|
||||
: event_id(id), created_ts(ts), data(data), severity_level(level) {}
|
||||
|
||||
// Converts to dictionary in a base::Value.
|
||||
void ToValue(base::Value& dict) const;
|
||||
base::Value::Dict ToValue() const;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
@ -111,14 +111,15 @@ bool PadSecret(const std::string& secret, std::string* out) {
|
||||
std::memcpy(&padded_secret[padded_length - secret.size()], secret.data(),
|
||||
secret.size());
|
||||
|
||||
base::Value pwd_padding_dict(base::Value::Type::DICT);
|
||||
pwd_padding_dict.SetStringKey(kPaddedPassword, padded_secret);
|
||||
pwd_padding_dict.SetIntKey(kPasswordLength, secret.size());
|
||||
auto pwd_padding_dict =
|
||||
base::Value::Dict()
|
||||
.Set(kPaddedPassword, padded_secret)
|
||||
.Set(kPasswordLength, static_cast<int>(secret.size()));
|
||||
SecurelyClearString(padded_secret);
|
||||
|
||||
auto result = base::JSONWriter::Write(pwd_padding_dict, out);
|
||||
const std::string* password_value =
|
||||
pwd_padding_dict.FindStringKey(kPaddedPassword);
|
||||
pwd_padding_dict.FindString(kPaddedPassword);
|
||||
if (password_value)
|
||||
SecurelyClearString(*const_cast<std::string*>(password_value));
|
||||
|
||||
|
@ -43,9 +43,9 @@ TEST_P(GcpWinHttpUrlFetcherTest,
|
||||
base::TimeDelta request_timeout = base::Milliseconds(timeout_in_millis);
|
||||
absl::optional<base::Value> request_result;
|
||||
|
||||
base::Value expected_result(base::Value::Type::DICT);
|
||||
expected_result.SetStringKey("response-str-key", "response-str-value");
|
||||
expected_result.SetIntKey("response-int-key", 4321);
|
||||
auto expected_result = base::Value::Dict()
|
||||
.Set("response-str-key", "response-str-value")
|
||||
.Set("response-int-key", 4321);
|
||||
std::string expected_response;
|
||||
base::JSONWriter::Write(expected_result, &expected_response);
|
||||
|
||||
|
@ -98,19 +98,19 @@ MULTIPROCESS_TEST_MAIN(gls_main) {
|
||||
expected_gaia_id = gaia_id_override;
|
||||
}
|
||||
|
||||
base::Value dict(base::Value::Type::DICT);
|
||||
base::Value::Dict dict;
|
||||
if (!gaia_id_override.empty() && gaia_id_override != expected_gaia_id) {
|
||||
dict.SetIntKey(kKeyExitCode, kUiecEMailMissmatch);
|
||||
dict.Set(kKeyExitCode, kUiecEMailMissmatch);
|
||||
} else {
|
||||
dict.SetIntKey(kKeyExitCode, static_cast<UiExitCodes>(default_exit_code));
|
||||
dict.SetStringKey(kKeyEmail, expected_email);
|
||||
dict.SetStringKey(kKeyFullname, full_name);
|
||||
dict.SetStringKey(kKeyId, expected_gaia_id);
|
||||
dict.SetStringKey(kKeyAccessToken, "at-123456");
|
||||
dict.SetStringKey(kKeyMdmIdToken, "idt-123456");
|
||||
dict.SetStringKey(kKeyPassword, gaia_password);
|
||||
dict.SetStringKey(kKeyRefreshToken, "rt-123456");
|
||||
dict.SetStringKey(kKeyTokenHandle, "th-123456");
|
||||
dict.Set(kKeyExitCode, static_cast<UiExitCodes>(default_exit_code));
|
||||
dict.Set(kKeyEmail, expected_email);
|
||||
dict.Set(kKeyFullname, full_name);
|
||||
dict.Set(kKeyId, expected_gaia_id);
|
||||
dict.Set(kKeyAccessToken, "at-123456");
|
||||
dict.Set(kKeyMdmIdToken, "idt-123456");
|
||||
dict.Set(kKeyPassword, gaia_password);
|
||||
dict.Set(kKeyRefreshToken, "rt-123456");
|
||||
dict.Set(kKeyTokenHandle, "th-123456");
|
||||
}
|
||||
|
||||
std::string json;
|
||||
|
@ -603,7 +603,7 @@ TEST_F(DeviceCapabilitiesImplTest, MergeDictionary) {
|
||||
|
||||
// Now just update one of the fields. Make sure the updated value is changed
|
||||
// in DeviceCapabilities and the other field remains untouched.
|
||||
deserialized_value->SetIntKey("dummy_field_int", 100);
|
||||
deserialized_value->GetDict().Set("dummy_field_int", 100);
|
||||
ASSERT_TRUE(deserialized_value->RemoveKey("dummy_field_bool"));
|
||||
|
||||
capabilities()->MergeDictionary(*deserialized_value);
|
||||
|
@ -55,7 +55,7 @@ Also consider the maximum size of any string parameters:
|
||||
NetLog parameters are specified as a JSON serializable `base::Value` which does
|
||||
not support 64-bit integers.
|
||||
|
||||
Be careful when using `base::Value::SetIntKey()` as it will truncate 64-bit
|
||||
Be careful when using `base::Value::Dict::Set()` as it will truncate 64-bit
|
||||
values to 32-bits.
|
||||
|
||||
Instead use `NetLogNumberValue()`.
|
||||
|
Reference in New Issue
Block a user