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

Side by Side Diff: chromecast/net/net_util_cast.cc

Issue 1284833004: Remove remaining legacy SplitString calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « chromecast/base/metrics/cast_metrics_helper.cc ('k') | chromeos/dbus/dbus_client_bundle.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/net/net_util_cast.h" 5 #include "chromecast/net/net_util_cast.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "chromecast/base/cast_sys_info_util.h" 9 #include "chromecast/base/cast_sys_info_util.h"
10 #include "chromecast/net/net_switches.h" 10 #include "chromecast/net/net_switches.h"
11 #include "chromecast/public/cast_sys_info.h" 11 #include "chromecast/public/cast_sys_info.h"
12 12
13 namespace chromecast { 13 namespace chromecast {
14 14
15 base::hash_set<std::string> GetIgnoredInterfaces() { 15 base::hash_set<std::string> GetIgnoredInterfaces() {
16 base::hash_set<std::string> ignored_interfaces; 16 base::hash_set<std::string> ignored_interfaces;
17 scoped_ptr<CastSysInfo> sys_info = CreateSysInfo(); 17 scoped_ptr<CastSysInfo> sys_info = CreateSysInfo();
18 if (!sys_info->GetApInterface().empty()) 18 if (!sys_info->GetApInterface().empty())
19 ignored_interfaces.insert(sys_info->GetApInterface()); 19 ignored_interfaces.insert(sys_info->GetApInterface());
20 20
21 // Add interfaces from "netif-to-ignore" switch. 21 // Add interfaces from "netif-to-ignore" switch.
22 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 22 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
23 base::CommandLine::StringType netifs_to_ignore_str = 23 base::CommandLine::StringType netifs_to_ignore_str =
24 command_line->GetSwitchValueNative(switches::kNetifsToIgnore); 24 command_line->GetSwitchValueNative(switches::kNetifsToIgnore);
25 base::CommandLine::StringVector netifs_to_ignore_vector; 25 for (const std::string& netif : base::SplitString(
26 base::SplitString(netifs_to_ignore_str, ',', &netifs_to_ignore_vector); 26 netifs_to_ignore_str, ",", base::TRIM_WHITESPACE,
27 for (const auto& netif : netifs_to_ignore_vector) 27 base::SPLIT_WANT_ALL))
28 ignored_interfaces.insert(netif); 28 ignored_interfaces.insert(netif);
29 29
30 return ignored_interfaces; 30 return ignored_interfaces;
31 } 31 }
32 32
33 } // namespace chromecast 33 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/base/metrics/cast_metrics_helper.cc ('k') | chromeos/dbus/dbus_client_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698