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

Side by Side Diff: chromeos/dbus/fake_shill_manager_client.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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
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 "chromeos/dbus/fake_shill_manager_client.h" 5 #include "chromeos/dbus/fake_shill_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 s_tdls_busy_count = 1; 1108 s_tdls_busy_count = 1;
1109 return true; 1109 return true;
1110 } else if (arg0 == "roaming") { 1110 } else if (arg0 == "roaming") {
1111 // "home", "roaming", or "required" 1111 // "home", "roaming", or "required"
1112 roaming_state_ = arg1; 1112 roaming_state_ = arg1;
1113 return true; 1113 return true;
1114 } 1114 }
1115 return SetInitialNetworkState(arg0, arg1); 1115 return SetInitialNetworkState(arg0, arg1);
1116 } 1116 }
1117 1117
1118 bool FakeShillManagerClient::SetInitialNetworkState(std::string type_arg, 1118 bool FakeShillManagerClient::SetInitialNetworkState(
1119 std::string state_arg) { 1119 const std::string& type_arg,
1120 const std::string& state_arg) {
1120 int state_arg_as_int = -1; 1121 int state_arg_as_int = -1;
1121 base::StringToInt(state_arg, &state_arg_as_int); 1122 base::StringToInt(state_arg, &state_arg_as_int);
1122 1123
1123 std::string state; 1124 std::string state;
1124 if (state_arg.empty() || state_arg == "1" || state_arg == "on" || 1125 if (state_arg.empty() || state_arg == "1" || state_arg == "on" ||
1125 state_arg == "enabled" || state_arg == "connected" || 1126 state_arg == "enabled" || state_arg == "connected" ||
1126 state_arg == "online") { 1127 state_arg == "online") {
1127 // Enabled and connected (default value) 1128 // Enabled and connected (default value)
1128 state = shill::kStateOnline; 1129 state = shill::kStateOnline;
1129 } else if (state_arg == "0" || state_arg == "off" || 1130 } else if (state_arg == "0" || state_arg == "off" ||
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 LOG(WARNING) << "Invalid state: " << state << " for " << type; 1211 LOG(WARNING) << "Invalid state: " << state << " for " << type;
1211 result = shill::kStateIdle; 1212 result = shill::kStateIdle;
1212 } 1213 }
1213 } 1214 }
1214 VLOG(1) << "Initial state for: " << type << " = " << result 1215 VLOG(1) << "Initial state for: " << type << " = " << result
1215 << " Enabled: " << *enabled; 1216 << " Enabled: " << *enabled;
1216 return result; 1217 return result;
1217 } 1218 }
1218 1219
1219 } // namespace chromeos 1220 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698