OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/address_list_net_log_param.h" | 5 #include "net/base/address_list_net_log_param.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "net/base/net_util.h" | 8 #include "net/base/net_util.h" |
9 #include "net/base/sys_addrinfo.h" | 9 #include "net/base/sys_addrinfo.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 AddressListNetLogParam::AddressListNetLogParam(const AddressList& address_list) | 13 AddressListNetLogParam::AddressListNetLogParam(const AddressList& address_list) |
14 : address_list_(address_list) { | 14 : address_list_(address_list) { |
15 } | 15 } |
16 | 16 |
17 Value* AddressListNetLogParam::ToValue() const { | 17 Value* AddressListNetLogParam::ToValue() const { |
18 DictionaryValue* dict = new DictionaryValue(); | 18 DictionaryValue* dict = new DictionaryValue(); |
19 ListValue* list = new ListValue(); | 19 ListValue* list = new ListValue(); |
20 | 20 |
21 for (const addrinfo* head = address_list_.head(); | 21 for (const addrinfo* head = address_list_.head(); |
22 head != NULL ; head = head->ai_next) { | 22 head != NULL ; head = head->ai_next) { |
23 list->Append(Value::CreateStringValue(NetAddressToStringWithPort(head))); | 23 list->Append(base::StringValue::New(NetAddressToStringWithPort(head))); |
24 } | 24 } |
25 | 25 |
26 dict->Set("address_list", list); | 26 dict->Set("address_list", list); |
27 return dict; | 27 return dict; |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
OLD | NEW |