Commit 85bd28af authored by Panos Astithas's avatar Panos Astithas Committed by Commit Bot

Remove base::DictionaryValue usage in net::GetNetInfo()

Bug: 646113
Change-Id: Ib16b182766ec63175c49ba6dc27d5a4ae1d67677
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2256157
Commit-Queue: Panos Astithas <pastithas@google.com>
Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783785}
parent fb79aaee
...@@ -676,7 +676,7 @@ void CronetURLRequestContext::NetworkTasks::StopNetLog() { ...@@ -676,7 +676,7 @@ void CronetURLRequestContext::NetworkTasks::StopNetLog() {
if (!net_log_file_observer_) if (!net_log_file_observer_)
return; return;
net_log_file_observer_->StopObserving( net_log_file_observer_->StopObserving(
GetNetLogInfo(), base::Value::ToUniquePtrValue(GetNetLogInfo()),
base::BindOnce( base::BindOnce(
&CronetURLRequestContext::NetworkTasks::StopNetLogCompleted, &CronetURLRequestContext::NetworkTasks::StopNetLogCompleted,
base::Unretained(this))); base::Unretained(this)));
...@@ -688,13 +688,12 @@ void CronetURLRequestContext::NetworkTasks::StopNetLogCompleted() { ...@@ -688,13 +688,12 @@ void CronetURLRequestContext::NetworkTasks::StopNetLogCompleted() {
callback_->OnStopNetLogCompleted(); callback_->OnStopNetLogCompleted();
} }
std::unique_ptr<base::DictionaryValue> base::Value CronetURLRequestContext::NetworkTasks::GetNetLogInfo() const {
CronetURLRequestContext::NetworkTasks::GetNetLogInfo() const { base::Value net_info =
std::unique_ptr<base::DictionaryValue> net_info =
net::GetNetInfo(context_.get(), net::NET_INFO_ALL_SOURCES); net::GetNetInfo(context_.get(), net::NET_INFO_ALL_SOURCES);
if (effective_experimental_options_) { if (effective_experimental_options_) {
net_info->Set("cronetExperimentalParams", net_info.SetKey("cronetExperimentalParams",
effective_experimental_options_->CreateDeepCopy()); effective_experimental_options_->Clone());
} }
return net_info; return net_info;
} }
......
...@@ -242,7 +242,7 @@ class CronetURLRequestContext { ...@@ -242,7 +242,7 @@ class CronetURLRequestContext {
private: private:
friend class TestUtil; friend class TestUtil;
std::unique_ptr<base::DictionaryValue> GetNetLogInfo() const; base::Value GetNetLogInfo() const;
std::unique_ptr<net::FileNetLogObserver> net_log_file_observer_; std::unique_ptr<net::FileNetLogObserver> net_log_file_observer_;
......
...@@ -156,7 +156,7 @@ class CronetEnvironment { ...@@ -156,7 +156,7 @@ class CronetEnvironment {
void StartNetLogOnNetworkThread(const base::FilePath&, bool log_bytes); void StartNetLogOnNetworkThread(const base::FilePath&, bool log_bytes);
void StopNetLogOnNetworkThread(base::WaitableEvent* log_stopped_event); void StopNetLogOnNetworkThread(base::WaitableEvent* log_stopped_event);
std::unique_ptr<base::DictionaryValue> GetNetLogInfo() const; base::Value GetNetLogInfo() const;
// Returns the HttpNetworkSession object from the passed in // Returns the HttpNetworkSession object from the passed in
// URLRequestContext or NULL if none exists. // URLRequestContext or NULL if none exists.
......
...@@ -201,20 +201,20 @@ void CronetEnvironment::StopNetLogOnNetworkThread( ...@@ -201,20 +201,20 @@ void CronetEnvironment::StopNetLogOnNetworkThread(
if (file_net_log_observer_) { if (file_net_log_observer_) {
DLOG(WARNING) << "Stopped NetLog."; DLOG(WARNING) << "Stopped NetLog.";
file_net_log_observer_->StopObserving( file_net_log_observer_->StopObserving(
GetNetLogInfo(), base::BindOnce(&SignalEvent, log_stopped_event)); base::Value::ToUniquePtrValue(GetNetLogInfo()),
base::BindOnce(&SignalEvent, log_stopped_event));
file_net_log_observer_.reset(); file_net_log_observer_.reset();
} else { } else {
log_stopped_event->Signal(); log_stopped_event->Signal();
} }
} }
std::unique_ptr<base::DictionaryValue> CronetEnvironment::GetNetLogInfo() base::Value CronetEnvironment::GetNetLogInfo() const {
const { base::Value net_info =
std::unique_ptr<base::DictionaryValue> net_info =
net::GetNetInfo(main_context_.get(), net::NET_INFO_ALL_SOURCES); net::GetNetInfo(main_context_.get(), net::NET_INFO_ALL_SOURCES);
if (effective_experimental_options_) { if (effective_experimental_options_) {
net_info->Set("cronetExperimentalParams", net_info.SetKey("cronetExperimentalParams",
effective_experimental_options_->CreateDeepCopy()); effective_experimental_options_->Clone());
} }
return net_info; return net_info;
} }
......
...@@ -353,13 +353,12 @@ base::Value GetNetConstants() { ...@@ -353,13 +353,12 @@ base::Value GetNetConstants() {
return constants_dict; return constants_dict;
} }
NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo( NET_EXPORT base::Value GetNetInfo(URLRequestContext* context,
URLRequestContext* context, int info_sources) {
int info_sources) {
// May only be called on the context's thread. // May only be called on the context's thread.
context->AssertCalledOnValidThread(); context->AssertCalledOnValidThread();
std::unique_ptr<base::DictionaryValue> net_info_dict = base::Value net_info_dict =
context->proxy_resolution_service()->GetProxyNetLogValues(info_sources); context->proxy_resolution_service()->GetProxyNetLogValues(info_sources);
if (info_sources & NET_INFO_HOST_RESOLVER) { if (info_sources & NET_INFO_HOST_RESOLVER) {
...@@ -367,27 +366,29 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo( ...@@ -367,27 +366,29 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo(
DCHECK(host_resolver); DCHECK(host_resolver);
HostCache* cache = host_resolver->GetHostCache(); HostCache* cache = host_resolver->GetHostCache();
if (cache) { if (cache) {
auto dict = std::make_unique<base::DictionaryValue>(); base::Value dict(base::Value::Type::DICTIONARY);
std::unique_ptr<base::Value> dns_config = std::unique_ptr<base::Value> dns_config =
host_resolver->GetDnsConfigAsValue(); host_resolver->GetDnsConfigAsValue();
if (dns_config) if (dns_config)
dict->Set("dns_config", std::move(dns_config)); dict.SetKey("dns_config",
base::Value::FromUniquePtrValue(std::move(dns_config)));
auto cache_info_dict = std::make_unique<base::DictionaryValue>(); base::Value cache_info_dict(base::Value::Type::DICTIONARY);
auto cache_contents_list = std::make_unique<base::ListValue>(); base::Value cache_contents_list(base::Value::Type::LIST);
cache_info_dict->SetInteger("capacity", cache_info_dict.SetIntKey("capacity",
static_cast<int>(cache->max_entries())); static_cast<int>(cache->max_entries()));
cache_info_dict->SetInteger("network_changes", cache->network_changes()); cache_info_dict.SetIntKey("network_changes", cache->network_changes());
cache->GetAsListValue(cache_contents_list.get(), base::ListValue* list_value = nullptr;
true /* include_staleness */, if (cache_contents_list.GetAsList(&list_value))
HostCache::SerializationType::kDebug); cache->GetAsListValue(list_value, true /* include_staleness */,
cache_info_dict->Set("entries", std::move(cache_contents_list)); HostCache::SerializationType::kDebug);
cache_info_dict.SetKey("entries", std::move(cache_contents_list));
dict->Set("cache", std::move(cache_info_dict)); dict.SetKey("cache", std::move(cache_info_dict));
net_info_dict->Set(NetInfoSourceToString(NET_INFO_HOST_RESOLVER), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_HOST_RESOLVER),
std::move(dict)); std::move(dict));
} }
} }
...@@ -395,20 +396,23 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo( ...@@ -395,20 +396,23 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo(
context->http_transaction_factory()->GetSession(); context->http_transaction_factory()->GetSession();
if (info_sources & NET_INFO_SOCKET_POOL) { if (info_sources & NET_INFO_SOCKET_POOL) {
net_info_dict->Set(NetInfoSourceToString(NET_INFO_SOCKET_POOL), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_SOCKET_POOL),
http_network_session->SocketPoolInfoToValue()); base::Value::FromUniquePtrValue(
http_network_session->SocketPoolInfoToValue()));
} }
if (info_sources & NET_INFO_SPDY_SESSIONS) { if (info_sources & NET_INFO_SPDY_SESSIONS) {
net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_SESSIONS), net_info_dict.SetKey(
http_network_session->SpdySessionPoolInfoToValue()); NetInfoSourceToString(NET_INFO_SPDY_SESSIONS),
base::Value::FromUniquePtrValue(
http_network_session->SpdySessionPoolInfoToValue()));
} }
if (info_sources & NET_INFO_SPDY_STATUS) { if (info_sources & NET_INFO_SPDY_STATUS) {
auto status_dict = std::make_unique<base::DictionaryValue>(); base::Value status_dict(base::Value::Type::DICTIONARY);
status_dict->SetBoolean("enable_http2", status_dict.SetBoolKey("enable_http2",
http_network_session->params().enable_http2); http_network_session->params().enable_http2);
NextProtoVector alpn_protos; NextProtoVector alpn_protos;
http_network_session->GetAlpnProtos(&alpn_protos); http_network_session->GetAlpnProtos(&alpn_protos);
...@@ -419,29 +423,31 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo( ...@@ -419,29 +423,31 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo(
next_protos_string.append(","); next_protos_string.append(",");
next_protos_string.append(NextProtoToString(proto)); next_protos_string.append(NextProtoToString(proto));
} }
status_dict->SetString("alpn_protos", next_protos_string); status_dict.SetStringKey("alpn_protos", next_protos_string);
} }
net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_STATUS), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_SPDY_STATUS),
std::move(status_dict)); std::move(status_dict));
} }
if (info_sources & NET_INFO_ALT_SVC_MAPPINGS) { if (info_sources & NET_INFO_ALT_SVC_MAPPINGS) {
const HttpServerProperties& http_server_properties = const HttpServerProperties& http_server_properties =
*context->http_server_properties(); *context->http_server_properties();
net_info_dict->Set( net_info_dict.SetKey(
NetInfoSourceToString(NET_INFO_ALT_SVC_MAPPINGS), NetInfoSourceToString(NET_INFO_ALT_SVC_MAPPINGS),
http_server_properties.GetAlternativeServiceInfoAsValue()); base::Value::FromUniquePtrValue(
http_server_properties.GetAlternativeServiceInfoAsValue()));
} }
if (info_sources & NET_INFO_QUIC) { if (info_sources & NET_INFO_QUIC) {
net_info_dict->Set(NetInfoSourceToString(NET_INFO_QUIC), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_QUIC),
http_network_session->QuicInfoToValue()); base::Value::FromUniquePtrValue(
http_network_session->QuicInfoToValue()));
} }
if (info_sources & NET_INFO_HTTP_CACHE) { if (info_sources & NET_INFO_HTTP_CACHE) {
auto info_dict = std::make_unique<base::DictionaryValue>(); base::Value info_dict(base::Value::Type::DICTIONARY);
auto stats_dict = std::make_unique<base::DictionaryValue>(); base::Value stats_dict(base::Value::Type::DICTIONARY);
disk_cache::Backend* disk_cache = GetDiskCacheBackend(context); disk_cache::Backend* disk_cache = GetDiskCacheBackend(context);
...@@ -449,14 +455,14 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo( ...@@ -449,14 +455,14 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo(
// Extract the statistics key/value pairs from the backend. // Extract the statistics key/value pairs from the backend.
base::StringPairs stats; base::StringPairs stats;
disk_cache->GetStats(&stats); disk_cache->GetStats(&stats);
for (size_t i = 0; i < stats.size(); ++i) { for (auto& stat : stats) {
stats_dict->SetKey(stats[i].first, base::Value(stats[i].second)); stats_dict.SetKey(stat.first, base::Value(std::move(stat.second)));
} }
} }
info_dict->Set("stats", std::move(stats_dict)); info_dict.SetKey("stats", std::move(stats_dict));
net_info_dict->Set(NetInfoSourceToString(NET_INFO_HTTP_CACHE), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_HTTP_CACHE),
std::move(info_dict)); std::move(info_dict));
} }
if (info_sources & NET_INFO_REPORTING) { if (info_sources & NET_INFO_REPORTING) {
...@@ -470,20 +476,20 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo( ...@@ -470,20 +476,20 @@ NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo(
reporting_dict.SetKey("networkErrorLogging", reporting_dict.SetKey("networkErrorLogging",
network_error_logging_service->StatusAsValue()); network_error_logging_service->StatusAsValue());
} }
net_info_dict->SetKey(NetInfoSourceToString(NET_INFO_REPORTING), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_REPORTING),
std::move(reporting_dict)); std::move(reporting_dict));
} else { } else {
base::Value reporting_dict(base::Value::Type::DICTIONARY); base::Value reporting_dict(base::Value::Type::DICTIONARY);
reporting_dict.SetKey("reportingEnabled", base::Value(false)); reporting_dict.SetKey("reportingEnabled", base::Value(false));
net_info_dict->SetKey(NetInfoSourceToString(NET_INFO_REPORTING), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_REPORTING),
std::move(reporting_dict)); std::move(reporting_dict));
} }
#else // BUILDFLAG(ENABLE_REPORTING) #else // BUILDFLAG(ENABLE_REPORTING)
base::Value reporting_dict(base::Value::Type::DICTIONARY); base::Value reporting_dict(base::Value::Type::DICTIONARY);
reporting_dict.SetKey("reportingEnabled", base::Value(false)); reporting_dict.SetKey("reportingEnabled", base::Value(false));
net_info_dict->SetKey(NetInfoSourceToString(NET_INFO_REPORTING), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_REPORTING),
std::move(reporting_dict)); std::move(reporting_dict));
#endif // BUILDFLAG(ENABLE_REPORTING) #endif // BUILDFLAG(ENABLE_REPORTING)
} }
......
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
#include "net/base/net_export.h" #include "net/base/net_export.h"
#include "net/log/net_log.h" #include "net/log/net_log.h"
namespace base {
class DictionaryValue;
}
namespace net { namespace net {
class URLRequestContext; class URLRequestContext;
...@@ -42,9 +38,7 @@ NET_EXPORT base::Value GetNetConstants(); ...@@ -42,9 +38,7 @@ NET_EXPORT base::Value GetNetConstants();
// one top-level entry to the returned dictionary. // one top-level entry to the returned dictionary.
// //
// May only be called on |context|'s thread. // May only be called on |context|'s thread.
NET_EXPORT std::unique_ptr<base::DictionaryValue> GetNetInfo( NET_EXPORT base::Value GetNetInfo(URLRequestContext* context, int info_sources);
URLRequestContext* context,
int info_sources);
// Takes in a set of contexts and a NetLog::Observer, and passes in // Takes in a set of contexts and a NetLog::Observer, and passes in
// NetLog::Entries to the observer for certain NetLogSources with pending // NetLog::Entries to the observer for certain NetLogSources with pending
......
...@@ -40,21 +40,20 @@ TEST(NetLogUtil, GetNetInfo) { ...@@ -40,21 +40,20 @@ TEST(NetLogUtil, GetNetInfo) {
// Get NetInfo when there's no cache backend (It's only created on first use). // Get NetInfo when there's no cache backend (It's only created on first use).
EXPECT_FALSE(http_cache->GetCurrentBackend()); EXPECT_FALSE(http_cache->GetCurrentBackend());
std::unique_ptr<base::DictionaryValue> net_info_without_cache( base::Value net_info_without_cache(
GetNetInfo(&context, NET_INFO_ALL_SOURCES)); GetNetInfo(&context, NET_INFO_ALL_SOURCES));
EXPECT_FALSE(http_cache->GetCurrentBackend()); EXPECT_FALSE(http_cache->GetCurrentBackend());
EXPECT_GT(net_info_without_cache->size(), 0u); EXPECT_GT(net_info_without_cache.DictSize(), 0u);
// Fore creation of a cache backend, and get NetInfo again. // Fore creation of a cache backend, and get NetInfo again.
disk_cache::Backend* backend = nullptr; disk_cache::Backend* backend = nullptr;
EXPECT_EQ(OK, context.http_transaction_factory()->GetCache()->GetBackend( EXPECT_EQ(OK, context.http_transaction_factory()->GetCache()->GetBackend(
&backend, TestCompletionCallback().callback())); &backend, TestCompletionCallback().callback()));
EXPECT_TRUE(http_cache->GetCurrentBackend()); EXPECT_TRUE(http_cache->GetCurrentBackend());
std::unique_ptr<base::DictionaryValue> net_info_with_cache( base::Value net_info_with_cache = GetNetInfo(&context, NET_INFO_ALL_SOURCES);
GetNetInfo(&context, NET_INFO_ALL_SOURCES)); EXPECT_GT(net_info_with_cache.DictSize(), 0u);
EXPECT_GT(net_info_with_cache->size(), 0u);
EXPECT_EQ(net_info_without_cache->size(), net_info_with_cache->size()); EXPECT_EQ(net_info_without_cache.DictSize(), net_info_with_cache.DictSize());
} }
// Make sure CreateNetLogEntriesForActiveObjects works for requests from a // Make sure CreateNetLogEntriesForActiveObjects works for requests from a
......
...@@ -1348,39 +1348,38 @@ void ConfiguredProxyResolutionService::ForceReloadProxyConfig() { ...@@ -1348,39 +1348,38 @@ void ConfiguredProxyResolutionService::ForceReloadProxyConfig() {
ApplyProxyConfigIfAvailable(); ApplyProxyConfigIfAvailable();
} }
std::unique_ptr<base::DictionaryValue> base::Value ConfiguredProxyResolutionService::GetProxyNetLogValues(
ConfiguredProxyResolutionService::GetProxyNetLogValues(int info_sources) { int info_sources) {
std::unique_ptr<base::DictionaryValue> net_info_dict( base::Value net_info_dict(base::Value::Type::DICTIONARY);
new base::DictionaryValue());
if (info_sources & NET_INFO_PROXY_SETTINGS) { if (info_sources & NET_INFO_PROXY_SETTINGS) {
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); base::Value dict(base::Value::Type::DICTIONARY);
if (fetched_config_) if (fetched_config_)
dict->SetKey("original", fetched_config_->value().ToValue()); dict.SetKey("original", fetched_config_->value().ToValue());
if (config_) if (config_)
dict->SetKey("effective", config_->value().ToValue()); dict.SetKey("effective", config_->value().ToValue());
net_info_dict->Set(NetInfoSourceToString(NET_INFO_PROXY_SETTINGS), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_PROXY_SETTINGS),
std::move(dict)); std::move(dict));
} }
if (info_sources & NET_INFO_BAD_PROXIES) { if (info_sources & NET_INFO_BAD_PROXIES) {
auto list = std::make_unique<base::ListValue>(); base::Value list(base::Value::Type::LIST);
for (auto& it : proxy_retry_info_) { for (const auto& it : proxy_retry_info_) {
const std::string& proxy_uri = it.first; const std::string& proxy_uri = it.first;
const ProxyRetryInfo& retry_info = it.second; const ProxyRetryInfo& retry_info = it.second;
auto dict = std::make_unique<base::DictionaryValue>(); base::Value dict(base::Value::Type::DICTIONARY);
dict->SetString("proxy_uri", proxy_uri); dict.SetStringKey("proxy_uri", proxy_uri);
dict->SetString("bad_until", dict.SetStringKey("bad_until",
NetLog::TickCountToString(retry_info.bad_until)); NetLog::TickCountToString(retry_info.bad_until));
list->Append(std::move(dict)); list.Append(std::move(dict));
} }
net_info_dict->Set(NetInfoSourceToString(NET_INFO_BAD_PROXIES), net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_BAD_PROXIES),
std::move(list)); std::move(list));
} }
return net_info_dict; return net_info_dict;
......
...@@ -171,8 +171,7 @@ class NET_EXPORT ConfiguredProxyResolutionService ...@@ -171,8 +171,7 @@ class NET_EXPORT ConfiguredProxyResolutionService
void ForceReloadProxyConfig(); void ForceReloadProxyConfig();
// ProxyResolutionService // ProxyResolutionService
std::unique_ptr<base::DictionaryValue> GetProxyNetLogValues( base::Value GetProxyNetLogValues(int info_sources) override;
int info_sources) override;
// ProxyResolutionService // ProxyResolutionService
bool CastToConfiguredProxyResolutionService( bool CastToConfiguredProxyResolutionService(
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
#include "net/proxy_resolution/proxy_info.h" #include "net/proxy_resolution/proxy_info.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace base {
class DictionaryValue;
} // namespace base
namespace net { namespace net {
class ConfiguredProxyResolutionService; class ConfiguredProxyResolutionService;
...@@ -99,8 +95,7 @@ class NET_EXPORT ProxyResolutionService { ...@@ -99,8 +95,7 @@ class NET_EXPORT ProxyResolutionService {
// Returns proxy related debug information to be included in the NetLog. The // Returns proxy related debug information to be included in the NetLog. The
// data should be appropriate for any capture mode. |info_sources| is a bit // data should be appropriate for any capture mode. |info_sources| is a bit
// field of NET_INFO_SOURCE. // field of NET_INFO_SOURCE.
virtual std::unique_ptr<base::DictionaryValue> GetProxyNetLogValues( virtual base::Value GetProxyNetLogValues(int info_sources) = 0;
int info_sources) = 0;
// Returns true if |this| is an instance of ConfiguredProxyResolutionService // Returns true if |this| is an instance of ConfiguredProxyResolutionService
// and assigns |this| to the out parameter. Otherwise returns false and sets // and assigns |this| to the out parameter. Otherwise returns false and sets
......
...@@ -48,10 +48,9 @@ const ProxyRetryInfoMap& WindowsSystemProxyResolutionService::proxy_retry_info() ...@@ -48,10 +48,9 @@ const ProxyRetryInfoMap& WindowsSystemProxyResolutionService::proxy_retry_info()
return proxy_retry_info_; return proxy_retry_info_;
} }
std::unique_ptr<base::DictionaryValue> base::Value WindowsSystemProxyResolutionService::GetProxyNetLogValues(
WindowsSystemProxyResolutionService::GetProxyNetLogValues(int info_sources) { int info_sources) {
std::unique_ptr<base::DictionaryValue> net_info_dict( base::Value net_info_dict(base::Value::Type::DICTIONARY);
new base::DictionaryValue());
return net_info_dict; return net_info_dict;
} }
......
...@@ -47,8 +47,7 @@ class NET_EXPORT WindowsSystemProxyResolutionService ...@@ -47,8 +47,7 @@ class NET_EXPORT WindowsSystemProxyResolutionService
const NetLogWithSource& net_log) override; const NetLogWithSource& net_log) override;
void ClearBadProxiesCache() override; void ClearBadProxiesCache() override;
const ProxyRetryInfoMap& proxy_retry_info() const override; const ProxyRetryInfoMap& proxy_retry_info() const override;
std::unique_ptr<base::DictionaryValue> GetProxyNetLogValues( base::Value GetProxyNetLogValues(int info_sources) override;
int info_sources) override;
bool CastToConfiguredProxyResolutionService( bool CastToConfiguredProxyResolutionService(
ConfiguredProxyResolutionService** configured_proxy_resolution_service) ConfiguredProxyResolutionService** configured_proxy_resolution_service)
override WARN_UNUSED_RESULT; override WARN_UNUSED_RESULT;
......
...@@ -90,13 +90,13 @@ void NetLogExporter::Stop(base::Value polled_data_value, ...@@ -90,13 +90,13 @@ void NetLogExporter::Stop(base::Value polled_data_value,
return; return;
} }
std::unique_ptr<base::DictionaryValue> net_info = net::GetNetInfo( base::Value net_info = net::GetNetInfo(
network_context_->url_request_context(), net::NET_INFO_ALL_SOURCES); network_context_->url_request_context(), net::NET_INFO_ALL_SOURCES);
if (polled_data) if (polled_data)
net_info->MergeDictionary(polled_data); net_info.MergeDictionary(polled_data);
file_net_observer_->StopObserving( file_net_observer_->StopObserving(
std::move(net_info), base::Value::ToUniquePtrValue(std::move(net_info)),
base::BindOnce([](StopCallback sc) { std::move(sc).Run(net::OK); }, base::BindOnce([](StopCallback sc) { std::move(sc).Run(net::OK); },
std::move(callback))); std::move(callback)));
file_net_observer_ = nullptr; file_net_observer_ = nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment