Index: net/base/address_list.cc |
=================================================================== |
--- net/base/address_list.cc (revision 141407) |
+++ net/base/address_list.cc (working copy) |
@@ -5,6 +5,7 @@ |
#include "net/base/address_list.h" |
#include "base/logging.h" |
+#include "base/values.h" |
#include "net/base/net_util.h" |
#include "net/base/sys_addrinfo.h" |
@@ -59,11 +60,21 @@ |
set_canonical_name(front().ToStringWithoutPort()); |
} |
+base::Value* AddressList::NetLogCallback(NetLog::LogLevel log_level) const { |
+ DictionaryValue* dict = new DictionaryValue(); |
+ ListValue* list = new ListValue(); |
+ |
+ for (AddressList::const_iterator it = begin(); it != end(); ++it) |
+ list->Append(Value::CreateStringValue(it->ToString())); |
+ |
+ dict->Set("address_list", list); |
+ return dict; |
+} |
+ |
void SetPortOnAddressList(uint16 port, AddressList* list) { |
DCHECK(list); |
- for (AddressList::iterator it = list->begin(); it != list->end(); ++it) { |
+ for (AddressList::iterator it = list->begin(); it != list->end(); ++it) |
*it = IPEndPoint(it->address(), port); |
- } |
} |
} // namespace net |