OLD | NEW |
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 "net/test/spawned_test_server/local_test_server.h" | 5 #include "net/test/spawned_test_server/local_test_server.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 const base::Value& value = it.value(); | 206 const base::Value& value = it.value(); |
207 const std::string& key = it.key(); | 207 const std::string& key = it.key(); |
208 | 208 |
209 // Add arguments from a list. | 209 // Add arguments from a list. |
210 if (value.IsType(base::Value::Type::LIST)) { | 210 if (value.IsType(base::Value::Type::LIST)) { |
211 const base::ListValue* list = NULL; | 211 const base::ListValue* list = NULL; |
212 if (!value.GetAsList(&list) || !list || list->empty()) | 212 if (!value.GetAsList(&list) || !list || list->empty()) |
213 return false; | 213 return false; |
214 for (base::ListValue::const_iterator list_it = list->begin(); | 214 for (base::ListValue::const_iterator list_it = list->begin(); |
215 list_it != list->end(); ++list_it) { | 215 list_it != list->end(); ++list_it) { |
216 if (!AppendArgumentFromJSONValue(key, *(*list_it), command_line)) | 216 if (!AppendArgumentFromJSONValue(key, *list_it, command_line)) |
217 return false; | 217 return false; |
218 } | 218 } |
219 } else if (!AppendArgumentFromJSONValue(key, value, command_line)) { | 219 } else if (!AppendArgumentFromJSONValue(key, value, command_line)) { |
220 return false; | 220 return false; |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
224 // Append the appropriate server type argument. | 224 // Append the appropriate server type argument. |
225 switch (type()) { | 225 switch (type()) { |
226 case TYPE_HTTP: // The default type is HTTP, no argument required. | 226 case TYPE_HTTP: // The default type is HTTP, no argument required. |
(...skipping 19 matching lines...) Expand all Loading... |
246 break; | 246 break; |
247 default: | 247 default: |
248 NOTREACHED(); | 248 NOTREACHED(); |
249 return false; | 249 return false; |
250 } | 250 } |
251 | 251 |
252 return true; | 252 return true; |
253 } | 253 } |
254 | 254 |
255 } // namespace net | 255 } // namespace net |
OLD | NEW |