| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/socket/socket_api.h" | 5 #include "extensions/browser/api/socket/socket_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 | 704 |
| 705 std::vector<linked_ptr<core_api::socket::NetworkInterface> > create_arg; | 705 std::vector<linked_ptr<core_api::socket::NetworkInterface> > create_arg; |
| 706 create_arg.reserve(interface_list.size()); | 706 create_arg.reserve(interface_list.size()); |
| 707 for (net::NetworkInterfaceList::const_iterator i = interface_list.begin(); | 707 for (net::NetworkInterfaceList::const_iterator i = interface_list.begin(); |
| 708 i != interface_list.end(); | 708 i != interface_list.end(); |
| 709 ++i) { | 709 ++i) { |
| 710 linked_ptr<core_api::socket::NetworkInterface> info = | 710 linked_ptr<core_api::socket::NetworkInterface> info = |
| 711 make_linked_ptr(new core_api::socket::NetworkInterface); | 711 make_linked_ptr(new core_api::socket::NetworkInterface); |
| 712 info->name = i->name; | 712 info->name = i->name; |
| 713 info->address = net::IPAddressToString(i->address); | 713 info->address = net::IPAddressToString(i->address); |
| 714 info->prefix_length = i->network_prefix; | 714 info->prefix_length = i->prefix_length; |
| 715 create_arg.push_back(info); | 715 create_arg.push_back(info); |
| 716 } | 716 } |
| 717 | 717 |
| 718 results_ = core_api::socket::GetNetworkList::Results::Create(create_arg); | 718 results_ = core_api::socket::GetNetworkList::Results::Create(create_arg); |
| 719 SendResponse(true); | 719 SendResponse(true); |
| 720 } | 720 } |
| 721 | 721 |
| 722 SocketJoinGroupFunction::SocketJoinGroupFunction() {} | 722 SocketJoinGroupFunction::SocketJoinGroupFunction() {} |
| 723 | 723 |
| 724 SocketJoinGroupFunction::~SocketJoinGroupFunction() {} | 724 SocketJoinGroupFunction::~SocketJoinGroupFunction() {} |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 } else { | 979 } else { |
| 980 RemoveSocket(params_->socket_id); | 980 RemoveSocket(params_->socket_id); |
| 981 error_ = net::ErrorToString(result); | 981 error_ = net::ErrorToString(result); |
| 982 } | 982 } |
| 983 | 983 |
| 984 results_ = core_api::socket::Secure::Results::Create(result); | 984 results_ = core_api::socket::Secure::Results::Create(result); |
| 985 AsyncWorkCompleted(); | 985 AsyncWorkCompleted(); |
| 986 } | 986 } |
| 987 | 987 |
| 988 } // namespace extensions | 988 } // namespace extensions |
| OLD | NEW |