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

Side by Side Diff: extensions/browser/api/system_network/system_network_api.cc

Issue 2141753002: [Extensions] Code cleanup - const &s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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 | « extensions/browser/api/printer_provider/printer_provider_apitest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/system_network/system_network_api.h" 5 #include "extensions/browser/api/system_network/system_network_api.h"
6 6
7 namespace { 7 namespace {
8 const char kNetworkListError[] = "Network lookup failed or unsupported"; 8 const char kNetworkListError[] = "Network lookup failed or unsupported";
9 } // namespace 9 } // namespace
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 error_ = kNetworkListError; 55 error_ = kNetworkListError;
56 SendResponse(false); 56 SendResponse(false);
57 } 57 }
58 58
59 void SystemNetworkGetNetworkInterfacesFunction::SendResponseOnUIThread( 59 void SystemNetworkGetNetworkInterfacesFunction::SendResponseOnUIThread(
60 const net::NetworkInterfaceList& interface_list) { 60 const net::NetworkInterfaceList& interface_list) {
61 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 61 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
62 62
63 std::vector<api::system_network::NetworkInterface> create_arg; 63 std::vector<api::system_network::NetworkInterface> create_arg;
64 create_arg.reserve(interface_list.size()); 64 create_arg.reserve(interface_list.size());
65 for (const net::NetworkInterface interface : interface_list) { 65 for (const net::NetworkInterface& interface : interface_list) {
66 api::system_network::NetworkInterface info; 66 api::system_network::NetworkInterface info;
67 info.name = interface.name; 67 info.name = interface.name;
68 info.address = interface.address.ToString(); 68 info.address = interface.address.ToString();
69 info.prefix_length = interface.prefix_length; 69 info.prefix_length = interface.prefix_length;
70 create_arg.push_back(std::move(info)); 70 create_arg.push_back(std::move(info));
71 } 71 }
72 72
73 results_ = 73 results_ =
74 api::system_network::GetNetworkInterfaces::Results::Create(create_arg); 74 api::system_network::GetNetworkInterfaces::Results::Create(create_arg);
75 SendResponse(true); 75 SendResponse(true);
76 } 76 }
77 77
78 } // namespace api 78 } // namespace api
79 } // namespace extensions 79 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/printer_provider/printer_provider_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698