blob: 72332ef27d3cd64754681c78fd432d89193c6e6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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(NetAddressToStringWithPort(head)));
}
dict->Set("address_list", list);
return dict;
}
} // namespace
|