summaryrefslogtreecommitdiff
path: root/chromium/net/log
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/net/log
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/net/log')
-rw-r--r--chromium/net/log/file_net_log_observer.cc3
-rw-r--r--chromium/net/log/file_net_log_observer_unittest.cc10
-rw-r--r--chromium/net/log/net_log.cc12
-rw-r--r--chromium/net/log/net_log_entry.cc20
-rw-r--r--chromium/net/log/net_log_event_type_list.h44
-rw-r--r--chromium/net/log/net_log_source.cc4
-rw-r--r--chromium/net/log/net_log_source.h3
-rw-r--r--chromium/net/log/net_log_source_type_list.h3
-rw-r--r--chromium/net/log/net_log_util.cc128
-rw-r--r--chromium/net/log/net_log_util.h4
-rw-r--r--chromium/net/log/net_log_util_unittest.cc2
-rw-r--r--chromium/net/log/net_log_values.cc6
-rw-r--r--chromium/net/log/net_log_with_source.cc6
13 files changed, 141 insertions, 104 deletions
diff --git a/chromium/net/log/file_net_log_observer.cc b/chromium/net/log/file_net_log_observer.cc
index 722f95afaa2..1374fecc44c 100644
--- a/chromium/net/log/file_net_log_observer.cc
+++ b/chromium/net/log/file_net_log_observer.cc
@@ -481,7 +481,8 @@ FileNetLogObserver::FileNetLogObserver(
write_queue_(std::move(write_queue)),
file_writer_(std::move(file_writer)) {
if (!constants)
- constants = GetNetConstants();
+ constants = base::DictionaryValue::From(
+ base::Value::ToUniquePtrValue(GetNetConstants()));
file_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&FileNetLogObserver::FileWriter::Initialize,
base::Unretained(file_writer_.get()),
diff --git a/chromium/net/log/file_net_log_observer_unittest.cc b/chromium/net/log/file_net_log_observer_unittest.cc
index 860a98defe9..7de5d885a55 100644
--- a/chromium/net/log/file_net_log_observer_unittest.cc
+++ b/chromium/net/log/file_net_log_observer_unittest.cc
@@ -123,12 +123,12 @@ struct ParsedNetLog {
return ::testing::AssertionFailure() << "input is empty";
}
- base::JSONReader reader;
- base::Optional<base::Value> container_optional = reader.Read(input);
- if (!container_optional) {
- return ::testing::AssertionFailure() << reader.GetErrorMessage();
+ base::JSONReader::ValueWithError parsed_json =
+ base::JSONReader::ReadAndReturnValueWithError(input);
+ if (!parsed_json.value) {
+ return ::testing::AssertionFailure() << parsed_json.error_message;
}
- container = std::move(*container_optional);
+ container = std::move(*parsed_json.value);
if (!container.GetAsDictionary(&root)) {
return ::testing::AssertionFailure() << "Not a dictionary";
diff --git a/chromium/net/log/net_log.cc b/chromium/net/log/net_log.cc
index 6d10b0791c8..c648e76c2e5 100644
--- a/chromium/net/log/net_log.cc
+++ b/chromium/net/log/net_log.cc
@@ -198,11 +198,11 @@ const char* NetLog::EventTypeToString(NetLogEventType event) {
// static
base::Value NetLog::GetEventTypesAsValue() {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
for (int i = 0; i < static_cast<int>(NetLogEventType::COUNT); ++i) {
- dict.SetInteger(EventTypeToString(static_cast<NetLogEventType>(i)), i);
+ dict.SetIntKey(EventTypeToString(static_cast<NetLogEventType>(i)), i);
}
- return std::move(dict);
+ return dict;
}
// static
@@ -221,11 +221,11 @@ const char* NetLog::SourceTypeToString(NetLogSourceType source) {
// static
base::Value NetLog::GetSourceTypesAsValue() {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
for (int i = 0; i < static_cast<int>(NetLogSourceType::COUNT); ++i) {
- dict.SetInteger(SourceTypeToString(static_cast<NetLogSourceType>(i)), i);
+ dict.SetIntKey(SourceTypeToString(static_cast<NetLogSourceType>(i)), i);
}
- return std::move(dict);
+ return dict;
}
// static
diff --git a/chromium/net/log/net_log_entry.cc b/chromium/net/log/net_log_entry.cc
index d889aed4140..40fe04da449 100644
--- a/chromium/net/log/net_log_entry.cc
+++ b/chromium/net/log/net_log_entry.cc
@@ -25,27 +25,27 @@ NetLogEntry::NetLogEntry(NetLogEntry&& entry) = default;
NetLogEntry& NetLogEntry::operator=(NetLogEntry&& entry) = default;
base::Value NetLogEntry::ToValue() const {
- base::DictionaryValue entry_dict;
+ base::Value entry_dict(base::Value::Type::DICTIONARY);
- entry_dict.SetString("time", NetLog::TickCountToString(time));
+ entry_dict.SetStringKey("time", NetLog::TickCountToString(time));
// Set the entry source.
- base::DictionaryValue source_dict;
- source_dict.SetInteger("id", source.id);
- source_dict.SetInteger("type", static_cast<int>(source.type));
- source_dict.SetString("start_time",
- NetLog::TickCountToString(source.start_time));
+ base::Value source_dict(base::Value::Type::DICTIONARY);
+ source_dict.SetIntKey("id", source.id);
+ source_dict.SetIntKey("type", static_cast<int>(source.type));
+ source_dict.SetStringKey("start_time",
+ NetLog::TickCountToString(source.start_time));
entry_dict.SetKey("source", std::move(source_dict));
// Set the event info.
- entry_dict.SetInteger("type", static_cast<int>(type));
- entry_dict.SetInteger("phase", static_cast<int>(phase));
+ entry_dict.SetIntKey("type", static_cast<int>(type));
+ entry_dict.SetIntKey("phase", static_cast<int>(phase));
// Set the event-specific parameters.
if (!params.is_none())
entry_dict.SetKey("params", params.Clone());
- return std::move(entry_dict);
+ return entry_dict;
}
NetLogEntry NetLogEntry::Clone() const {
diff --git a/chromium/net/log/net_log_event_type_list.h b/chromium/net/log/net_log_event_type_list.h
index 12553338d45..36b24fb87a1 100644
--- a/chromium/net/log/net_log_event_type_list.h
+++ b/chromium/net/log/net_log_event_type_list.h
@@ -831,7 +831,7 @@ EVENT_TYPE(SOCKET_POOL_CLOSING_SOCKET)
// "initiator": <Initiator origin of the request, if any, or else "not an
// origin">,
// "load_flags": <Numeric value of the combined load flags>,
-// "privacy_mode": <True if privacy mode is enabled for the request>,
+// "privacy_mode": <Privacy mode associated with the request>,
// "network_isolation_key": <NIK associated with the request>,
// "priority": <Numeric priority of the request>,
// "site_for_cookies": <SiteForCookies associated with the request>,
@@ -2004,6 +2004,20 @@ EVENT_TYPE(QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_RECEIVED)
// }
EVENT_TYPE(QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_SENT)
+// A QUIC connection received transport parameters.
+// {
+// "quic_transport_parameters": <Human readable view of the transport
+// parameters>
+// }
+EVENT_TYPE(QUIC_SESSION_TRANSPORT_PARAMETERS_RECEIVED)
+
+// A QUIC connection sent transport parameters.
+// {
+// "quic_transport_parameters": <Human readable view of the transport
+// parameters>
+// }
+EVENT_TYPE(QUIC_SESSION_TRANSPORT_PARAMETERS_SENT)
+
// A QUIC connection received a PUSH_PROMISE frame. The following
// parameters are attached:
// {
@@ -2284,6 +2298,13 @@ EVENT_TYPE(QUIC_CONNECTION_MIGRATION_TRIGGERED)
// }
EVENT_TYPE(QUIC_CONNECTION_MIGRATION_FAILURE)
+// This event is emitted whenenver a platform notification is received that
+// could possibly trigger connection migration.
+// {
+// "signal": <Type of the platform notification>
+// }
+EVENT_TYPE(QUIC_CONNECTION_MIGRATION_PLATFORM_NOTIFICATION)
+
// Records a successful QUIC connection migration attempt of the session
// identified by connection_id.
// {
@@ -2357,6 +2378,15 @@ EVENT_TYPE(QUIC_CONNECTIVITY_PROBING_MANAGER_PROBE_SENT)
// }
EVENT_TYPE(QUIC_CONNECTIVITY_PROBING_MANAGER_PROBE_RECEIVED)
+// Records that QUIC connectivity probing manager receives STATLESS_RESET on the
+// following path:
+// {
+// "network": <ID of the network being probed>
+// "self_address": <Self address on the probed path>
+// "peer_address": <Peer address on the probed path>
+// }
+EVENT_TYPE(QUIC_CONNECTIVITY_PROBING_MANAGER_STATELESS_RESET_RECEIVED)
+
// ------------------------------------------------------------------------
// QuicPortMigration
// ------------------------------------------------------------------------
@@ -2628,13 +2658,21 @@ EVENT_TYPE(AUTH_LIBRARY_ACQUIRE_CREDS)
// This operation involves invoking an external library which may perform disk,
// IPC, and network IO as a part of its work.
//
-// On Posix platforms, the END phase has the following parameters.
+// On Windows, the BEGIN phase has the following parameters:
+// {
+// "spn": <Service Principle Name>,
+// "context_flags": <Integer with bitfield value>
+// }
+//
+// The END phase has the following parameters.
+//
+// On Posix platforms:
// {
// "context": <GSSAPI Context Description>,
// "status" : <GSSAPI Status if the operation failed>
// }
//
-// On Windows, the END phase has the following parameters.
+// On Windows:
// {
// "context": <SSPI Context Description>
// "status" : <SSPI SECURITY_STATUS>
diff --git a/chromium/net/log/net_log_source.cc b/chromium/net/log/net_log_source.cc
index 8386d63f338..a6c3eefdf0e 100644
--- a/chromium/net/log/net_log_source.cc
+++ b/chromium/net/log/net_log_source.cc
@@ -20,9 +20,9 @@ namespace {
base::Value SourceEventParametersCallback(const NetLogSource source) {
if (!source.IsValid())
return base::Value();
- base::DictionaryValue event_params;
+ base::Value event_params(base::Value::Type::DICTIONARY);
source.AddToEventParameters(&event_params);
- return std::move(event_params);
+ return event_params;
}
} // namespace
diff --git a/chromium/net/log/net_log_source.h b/chromium/net/log/net_log_source.h
index 01b091bd4b9..046f371c9f1 100644
--- a/chromium/net/log/net_log_source.h
+++ b/chromium/net/log/net_log_source.h
@@ -12,7 +12,6 @@
#include "net/log/net_log_source_type.h"
namespace base {
-class DictionaryValue;
class Value;
}
@@ -29,7 +28,7 @@ struct NET_EXPORT NetLogSource {
NetLogSource(NetLogSourceType type, uint32_t id, base::TimeTicks start_time);
bool IsValid() const;
- // Adds the source to a DictionaryValue containing event parameters,
+ // Adds the source to a dictionary containing event parameters,
// using the name "source_dependency".
void AddToEventParameters(base::Value* event_params) const;
diff --git a/chromium/net/log/net_log_source_type_list.h b/chromium/net/log/net_log_source_type_list.h
index ccde5695c03..15f1cdd6eb4 100644
--- a/chromium/net/log/net_log_source_type_list.h
+++ b/chromium/net/log/net_log_source_type_list.h
@@ -21,9 +21,8 @@ SOURCE_TYPE(TRANSPORT_CONNECT_JOB)
SOURCE_TYPE(WEB_SOCKET_TRANSPORT_CONNECT_JOB)
SOURCE_TYPE(SOCKET)
SOURCE_TYPE(HTTP2_SESSION)
-SOURCE_TYPE(QUIC_SESSION)
SOURCE_TYPE(QUIC_CONNECTION_MIGRATION)
-SOURCE_TYPE(QUIC_PORT_MIGRATION)
+SOURCE_TYPE(QUIC_SESSION)
SOURCE_TYPE(HOST_RESOLVER_IMPL_JOB)
SOURCE_TYPE(DISK_CACHE_ENTRY)
SOURCE_TYPE(MEMORY_CACHE_ENTRY)
diff --git a/chromium/net/log/net_log_util.cc b/chromium/net/log/net_log_util.cc
index b00221ea87d..91c57cc7da5 100644
--- a/chromium/net/log/net_log_util.cc
+++ b/chromium/net/log/net_log_util.cc
@@ -136,49 +136,48 @@ const char* NetInfoSourceToString(NetInfoSource source) {
return "?";
}
-std::unique_ptr<base::DictionaryValue> GetNetConstants() {
- std::unique_ptr<base::DictionaryValue> constants_dict(
- new base::DictionaryValue());
+base::Value GetNetConstants() {
+ base::Value constants_dict(base::Value::Type::DICTIONARY);
// Version of the file format.
- constants_dict->SetInteger("logFormatVersion", kLogFormatVersion);
+ constants_dict.SetIntKey("logFormatVersion", kLogFormatVersion);
// Add a dictionary with information on the relationship between event type
// enums and their symbolic names.
- constants_dict->SetKey("logEventTypes", NetLog::GetEventTypesAsValue());
+ constants_dict.SetKey("logEventTypes", NetLog::GetEventTypesAsValue());
// Add a dictionary with information about the relationship between CertStatus
// flags and their symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
for (const auto& flag : kCertStatusFlags)
- dict->SetInteger(flag.name, flag.constant);
+ dict.SetIntKey(flag.name, flag.constant);
- constants_dict->Set("certStatusFlag", std::move(dict));
+ constants_dict.SetKey("certStatusFlag", std::move(dict));
}
// Add a dictionary with information about the relationship between
// CertVerifier::VerifyFlags and their symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
- dict->SetInteger("VERIFY_DISABLE_NETWORK_FETCHES",
- CertVerifier::VERIFY_DISABLE_NETWORK_FETCHES);
+ dict.SetIntKey("VERIFY_DISABLE_NETWORK_FETCHES",
+ CertVerifier::VERIFY_DISABLE_NETWORK_FETCHES);
static_assert(CertVerifier::VERIFY_FLAGS_LAST == (1 << 0),
"Update with new flags");
- constants_dict->Set("certVerifierFlags", std::move(dict));
+ constants_dict.SetKey("certVerifierFlags", std::move(dict));
}
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
- dict->SetInteger(
+ dict.SetIntKey(
"kStrong",
static_cast<int>(SimplePathBuilderDelegate::DigestPolicy::kStrong));
- dict->SetInteger(
+ dict.SetIntKey(
"kWeakAllowSha1",
static_cast<int>(
SimplePathBuilderDelegate::DigestPolicy::kWeakAllowSha1));
@@ -187,127 +186,126 @@ std::unique_ptr<base::DictionaryValue> GetNetConstants() {
SimplePathBuilderDelegate::DigestPolicy::kWeakAllowSha1,
"Update with new flags");
- constants_dict->Set("certPathBuilderDigestPolicy", std::move(dict));
+ constants_dict.SetKey("certPathBuilderDigestPolicy", std::move(dict));
}
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
-
- dict->SetInteger("DISTRUSTED",
- static_cast<int>(CertificateTrustType::DISTRUSTED));
- dict->SetInteger("UNSPECIFIED",
- static_cast<int>(CertificateTrustType::UNSPECIFIED));
- dict->SetInteger("TRUSTED_ANCHOR",
- static_cast<int>(CertificateTrustType::TRUSTED_ANCHOR));
- dict->SetInteger(
- "TRUSTED_ANCHOR_WITH_CONSTRAINTS",
- static_cast<int>(
- CertificateTrustType::TRUSTED_ANCHOR_WITH_CONSTRAINTS));
+ base::Value dict(base::Value::Type::DICTIONARY);
+
+ dict.SetIntKey("DISTRUSTED",
+ static_cast<int>(CertificateTrustType::DISTRUSTED));
+ dict.SetIntKey("UNSPECIFIED",
+ static_cast<int>(CertificateTrustType::UNSPECIFIED));
+ dict.SetIntKey("TRUSTED_ANCHOR",
+ static_cast<int>(CertificateTrustType::TRUSTED_ANCHOR));
+ dict.SetIntKey("TRUSTED_ANCHOR_WITH_CONSTRAINTS",
+ static_cast<int>(
+ CertificateTrustType::TRUSTED_ANCHOR_WITH_CONSTRAINTS));
static_assert(CertificateTrustType::LAST ==
CertificateTrustType::TRUSTED_ANCHOR_WITH_CONSTRAINTS,
"Update with new flags");
- constants_dict->Set("certificateTrustType", std::move(dict));
+ constants_dict.SetKey("certificateTrustType", std::move(dict));
}
// Add a dictionary with information about the relationship between load flag
// enums and their symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
for (const auto& flag : kLoadFlags)
- dict->SetInteger(flag.name, flag.constant);
+ dict.SetIntKey(flag.name, flag.constant);
- constants_dict->Set("loadFlag", std::move(dict));
+ constants_dict.SetKey("loadFlag", std::move(dict));
}
// Add a dictionary with information about the relationship between load state
// enums and their symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
for (const auto& state : kLoadStateTable)
- dict->SetInteger(state.name, state.constant);
+ dict.SetIntKey(state.name, state.constant);
- constants_dict->Set("loadState", std::move(dict));
+ constants_dict.SetKey("loadState", std::move(dict));
}
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
#define NET_INFO_SOURCE(label, string, value) \
- dict->SetInteger(string, NET_INFO_##label);
+ dict.SetIntKey(string, NET_INFO_##label);
#include "net/base/net_info_source_list.h"
#undef NET_INFO_SOURCE
- constants_dict->Set("netInfoSources", std::move(dict));
+ constants_dict.SetKey("netInfoSources", std::move(dict));
}
// Add information on the relationship between net error codes and their
// symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
for (const auto& error : kNetErrors)
- dict->SetInteger(ErrorToShortString(error), error);
+ dict.SetIntKey(ErrorToShortString(error), error);
- constants_dict->Set("netError", std::move(dict));
+ constants_dict.SetKey("netError", std::move(dict));
}
// Add information on the relationship between QUIC error codes and their
// symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
for (quic::QuicErrorCode error = quic::QUIC_NO_ERROR;
error < quic::QUIC_LAST_ERROR;
error = static_cast<quic::QuicErrorCode>(error + 1)) {
- dict->SetInteger(QuicErrorCodeToString(error), static_cast<int>(error));
+ dict.SetIntKey(QuicErrorCodeToString(error), static_cast<int>(error));
}
- constants_dict->Set("quicError", std::move(dict));
+ constants_dict.SetKey("quicError", std::move(dict));
}
// Add information on the relationship between QUIC RST_STREAM error codes
// and their symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
for (quic::QuicRstStreamErrorCode error = quic::QUIC_STREAM_NO_ERROR;
error < quic::QUIC_STREAM_LAST_ERROR;
error = static_cast<quic::QuicRstStreamErrorCode>(error + 1)) {
- dict->SetInteger(QuicRstStreamErrorCodeToString(error),
- static_cast<int>(error));
+ dict.SetIntKey(QuicRstStreamErrorCodeToString(error),
+ static_cast<int>(error));
}
- constants_dict->Set("quicRstStreamError", std::move(dict));
+ constants_dict.SetKey("quicRstStreamError", std::move(dict));
}
// Information about the relationship between event phase enums and their
// symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
- dict->SetInteger("PHASE_BEGIN", static_cast<int>(NetLogEventPhase::BEGIN));
- dict->SetInteger("PHASE_END", static_cast<int>(NetLogEventPhase::END));
- dict->SetInteger("PHASE_NONE", static_cast<int>(NetLogEventPhase::NONE));
+ dict.SetIntKey("PHASE_BEGIN", static_cast<int>(NetLogEventPhase::BEGIN));
+ dict.SetIntKey("PHASE_END", static_cast<int>(NetLogEventPhase::END));
+ dict.SetIntKey("PHASE_NONE", static_cast<int>(NetLogEventPhase::NONE));
- constants_dict->Set("logEventPhase", std::move(dict));
+ constants_dict.SetKey("logEventPhase", std::move(dict));
}
// Information about the relationship between source type enums and
// their symbolic names.
- constants_dict->SetKey("logSourceType", NetLog::GetSourceTypesAsValue());
+ constants_dict.SetKey("logSourceType", NetLog::GetSourceTypesAsValue());
// Information about the relationship between address family enums and
// their symbolic names.
{
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ base::Value dict(base::Value::Type::DICTIONARY);
- dict->SetInteger("ADDRESS_FAMILY_UNSPECIFIED", ADDRESS_FAMILY_UNSPECIFIED);
- dict->SetInteger("ADDRESS_FAMILY_IPV4", ADDRESS_FAMILY_IPV4);
- dict->SetInteger("ADDRESS_FAMILY_IPV6", ADDRESS_FAMILY_IPV6);
+ dict.SetIntKey("ADDRESS_FAMILY_UNSPECIFIED", ADDRESS_FAMILY_UNSPECIFIED);
+ dict.SetIntKey("ADDRESS_FAMILY_IPV4", ADDRESS_FAMILY_IPV4);
+ dict.SetIntKey("ADDRESS_FAMILY_IPV6", ADDRESS_FAMILY_IPV6);
- constants_dict->Set("addressFamily", std::move(dict));
+ constants_dict.SetKey("addressFamily", std::move(dict));
}
// Information about how the "time ticks" values we have given it relate to
@@ -327,14 +325,15 @@ std::unique_ptr<base::DictionaryValue> GetNetConstants() {
base::TimeTicks::Now() - base::TimeTicks();
int64_t tick_to_unix_time_ms =
(time_since_epoch - reference_time_ticks).InMilliseconds();
- constants_dict->SetKey("timeTickOffset",
- NetLogNumberValue(tick_to_unix_time_ms));
+ constants_dict.SetKey("timeTickOffset",
+ NetLogNumberValue(tick_to_unix_time_ms));
}
// TODO(eroman): Is this needed?
// "clientInfo" key is required for some log readers. Provide a default empty
// value for compatibility.
- constants_dict->Set("clientInfo", std::make_unique<base::DictionaryValue>());
+ constants_dict.SetKey("clientInfo",
+ base::Value(base::Value::Type::DICTIONARY));
// Add a list of active field experiments.
{
@@ -346,8 +345,9 @@ std::unique_ptr<base::DictionaryValue> GetNetConstants() {
it != active_groups.end(); ++it) {
field_trial_groups->AppendString(it->trial_name + ":" + it->group_name);
}
- constants_dict->Set("activeFieldTrialGroups",
- std::move(field_trial_groups));
+ constants_dict.SetKey(
+ "activeFieldTrialGroups",
+ base::Value::FromUniquePtrValue(std::move(field_trial_groups)));
}
return constants_dict;
diff --git a/chromium/net/log/net_log_util.h b/chromium/net/log/net_log_util.h
index 62c3dd06b6d..b6391aae8fe 100644
--- a/chromium/net/log/net_log_util.h
+++ b/chromium/net/log/net_log_util.h
@@ -33,8 +33,8 @@ enum NetInfoSource {
// Returns a friendly string to use for a given NetInfoSource in the net log.
NET_EXPORT const char* NetInfoSourceToString(NetInfoSource source);
-// Create a dictionary containing a legend for net/ constants.
-NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetConstants();
+// Creates a dictionary containing a legend for net/ constants.
+NET_EXPORT base::Value GetNetConstants();
// Retrieves a dictionary containing information about the current state of
// |context|. |info_sources| is a set of NetInfoSources OR'd together,
diff --git a/chromium/net/log/net_log_util_unittest.cc b/chromium/net/log/net_log_util_unittest.cc
index 73ba2670b94..7da26248f9b 100644
--- a/chromium/net/log/net_log_util_unittest.cc
+++ b/chromium/net/log/net_log_util_unittest.cc
@@ -27,7 +27,7 @@ namespace {
// Make sure GetNetConstants doesn't crash.
TEST(NetLogUtil, GetNetConstants) {
- std::unique_ptr<base::Value> constants(GetNetConstants());
+ base::Value constants(GetNetConstants());
}
// Make sure GetNetInfo doesn't crash when called on contexts with and without
diff --git a/chromium/net/log/net_log_values.cc b/chromium/net/log/net_log_values.cc
index d92d3fa2352..cc8bb8cdaa8 100644
--- a/chromium/net/log/net_log_values.cc
+++ b/chromium/net/log/net_log_values.cc
@@ -82,9 +82,9 @@ base::Value NetLogParamsWithInt(base::StringPiece name, int value) {
}
base::Value NetLogParamsWithInt64(base::StringPiece name, int64_t value) {
- base::DictionaryValue event_params;
- event_params.SetKey(name, NetLogNumberValue(value));
- return std::move(event_params);
+ base::Value params(base::Value::Type::DICTIONARY);
+ params.SetKey(name, NetLogNumberValue(value));
+ return params;
}
base::Value NetLogParamsWithBool(base::StringPiece name, bool value) {
diff --git a/chromium/net/log/net_log_with_source.cc b/chromium/net/log/net_log_with_source.cc
index 5a6cbe10ea1..e1a44ff8b79 100644
--- a/chromium/net/log/net_log_with_source.cc
+++ b/chromium/net/log/net_log_with_source.cc
@@ -25,11 +25,11 @@ namespace {
base::Value BytesTransferredParams(int byte_count,
const char* bytes,
NetLogCaptureMode capture_mode) {
- base::DictionaryValue dict;
- dict.SetInteger("byte_count", byte_count);
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetIntKey("byte_count", byte_count);
if (NetLogCaptureIncludesSocketBytes(capture_mode) && byte_count > 0)
dict.SetKey("bytes", NetLogBinaryValue(bytes, byte_count));
- return std::move(dict);
+ return dict;
}
} // namespace