Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: chrome/browser/extensions/api/socket/socket_api.cc

Issue 47443002: Added prefixLength to the items in the result of a getNetworkList. This allows the broadcast addres… (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/api/socket.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/api/socket.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698