diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-21 22:17:47 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-21 22:17:47 +0000 |
commit | eb8605cc05a24c5d444c43d3c559b44ce7a5a75e (patch) | |
tree | eefc9b78a69d6e740b06cc408cfe0dd8e159bcc4 /net/base | |
parent | b90490bbcbaad21ce539f1e7bd9dbfbfdeb164e1 (diff) | |
download | chromium_src-eb8605cc05a24c5d444c43d3c559b44ce7a5a75e.zip chromium_src-eb8605cc05a24c5d444c43d3c559b44ce7a5a75e.tar.gz chromium_src-eb8605cc05a24c5d444c43d3c559b44ce7a5a75e.tar.bz2 |
net-internals: Log the addresses that were attempted during a TCP connect, and any OS errors that attempts failed with (windows implementation)
Note that this change is the same as r47764, but for the windows implementation.
BUG=44488
Review URL: http://codereview.chromium.org/2127011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/address_list_net_log_param.cc | 30 | ||||
-rw-r--r-- | net/base/address_list_net_log_param.h | 28 | ||||
-rw-r--r-- | net/base/net_log_event_type_list.h | 2 |
3 files changed, 59 insertions, 1 deletions
diff --git a/net/base/address_list_net_log_param.cc b/net/base/address_list_net_log_param.cc new file mode 100644 index 0000000..9143ae9 --- /dev/null +++ b/net/base/address_list_net_log_param.cc @@ -0,0 +1,30 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/base/address_list_net_log_param.h" + +#include "base/values.h" +#include "net/base/net_util.h" +#include "net/base/sys_addrinfo.h" + +namespace net { + +AddressListNetLogParam::AddressListNetLogParam(const AddressList& address_list) + : address_list_(address_list) { +} + +Value* AddressListNetLogParam::ToValue() const { + DictionaryValue* dict = new DictionaryValue(); + ListValue* list = new ListValue(); + + for (const addrinfo* head = address_list_.head(); + head != NULL ; head = head->ai_next) { + list->Append(Value::CreateStringValue(NetAddressToString(head))); + } + + dict->Set(L"address_list", list); + return dict; +} + +} // namespace diff --git a/net/base/address_list_net_log_param.h b/net/base/address_list_net_log_param.h new file mode 100644 index 0000000..2a56961 --- /dev/null +++ b/net/base/address_list_net_log_param.h @@ -0,0 +1,28 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_BASE_ADDRESS_LIST_NET_LOG_PARAM_H_ +#define NET_BASE_ADDRESS_LIST_NET_LOG_PARAM_H_ + +#include "net/base/address_list.h" +#include "net/base/net_log.h" + +namespace net { + +// NetLog parameter to describe an address list. +// Note that AddressList uses ref-counted data, so this doesn't introduce +// much of a memory overhead. +class AddressListNetLogParam : public NetLog::EventParameters { + public: + explicit AddressListNetLogParam(const AddressList& address_list); + + virtual Value* ToValue() const; + + private: + AddressList address_list_; +}; + +} // namespace net + +#endif // NET_BASE_ADDRESS_LIST_NET_LOG_PARAM_H_ diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index 1c0aedf..30faee9 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -129,7 +129,7 @@ EVENT_TYPE(WAITING_FOR_SINGLE_PROXY_RESOLVER_THREAD) // The START event contains these parameters: // // { -// "addresses": <List of network address strings> +// "address_list": <List of network address strings> // } // // And the END event will contain the following parameters on failure: |