| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/socket/socket_api.h" | 5 #include "chrome/browser/extensions/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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 684 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 685 | 685 |
| 686 std::vector<linked_ptr<api::socket::NetworkInterface> > create_arg; | 686 std::vector<linked_ptr<api::socket::NetworkInterface> > create_arg; |
| 687 create_arg.reserve(interface_list.size()); | 687 create_arg.reserve(interface_list.size()); |
| 688 for (net::NetworkInterfaceList::const_iterator i = interface_list.begin(); | 688 for (net::NetworkInterfaceList::const_iterator i = interface_list.begin(); |
| 689 i != interface_list.end(); ++i) { | 689 i != interface_list.end(); ++i) { |
| 690 linked_ptr<api::socket::NetworkInterface> info = | 690 linked_ptr<api::socket::NetworkInterface> info = |
| 691 make_linked_ptr(new api::socket::NetworkInterface); | 691 make_linked_ptr(new api::socket::NetworkInterface); |
| 692 info->name = i->name; | 692 info->name = i->name; |
| 693 info->address = net::IPAddressToString(i->address); | 693 info->address = net::IPAddressToString(i->address); |
| 694 info->prefix_length = i->network_prefix; |
| 694 create_arg.push_back(info); | 695 create_arg.push_back(info); |
| 695 } | 696 } |
| 696 | 697 |
| 697 results_ = api::socket::GetNetworkList::Results::Create(create_arg); | 698 results_ = api::socket::GetNetworkList::Results::Create(create_arg); |
| 698 SendResponse(true); | 699 SendResponse(true); |
| 699 } | 700 } |
| 700 | 701 |
| 701 SocketJoinGroupFunction::SocketJoinGroupFunction() {} | 702 SocketJoinGroupFunction::SocketJoinGroupFunction() {} |
| 702 | 703 |
| 703 SocketJoinGroupFunction::~SocketJoinGroupFunction() {} | 704 SocketJoinGroupFunction::~SocketJoinGroupFunction() {} |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 return; | 890 return; |
| 890 } | 891 } |
| 891 | 892 |
| 892 base::ListValue* values = new base::ListValue(); | 893 base::ListValue* values = new base::ListValue(); |
| 893 values->AppendStrings((std::vector<std::string>&) | 894 values->AppendStrings((std::vector<std::string>&) |
| 894 static_cast<UDPSocket*>(socket)->GetJoinedGroups()); | 895 static_cast<UDPSocket*>(socket)->GetJoinedGroups()); |
| 895 SetResult(values); | 896 SetResult(values); |
| 896 } | 897 } |
| 897 | 898 |
| 898 } // namespace extensions | 899 } // namespace extensions |
| OLD | NEW |