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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 return true; | 192 return true; |
193 } | 193 } |
194 | 194 |
195 bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const { | 195 bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const { |
196 base::DictionaryValue arguments_dict; | 196 base::DictionaryValue arguments_dict; |
197 if (!GenerateArguments(&arguments_dict)) | 197 if (!GenerateArguments(&arguments_dict)) |
198 return false; | 198 return false; |
199 | 199 |
200 // Serialize the argument dictionary into CommandLine. | 200 // Serialize the argument dictionary into CommandLine. |
201 for (DictionaryValue::Iterator it(arguments_dict); !it.IsAtEnd(); | 201 for (base::DictionaryValue::Iterator it(arguments_dict); !it.IsAtEnd(); |
202 it.Advance()) { | 202 it.Advance()) { |
203 const base::Value& value = it.value(); | 203 const base::Value& value = it.value(); |
204 const std::string& key = it.key(); | 204 const std::string& key = it.key(); |
205 | 205 |
206 // Add arguments from a list. | 206 // Add arguments from a list. |
207 if (value.IsType(Value::TYPE_LIST)) { | 207 if (value.IsType(Value::TYPE_LIST)) { |
208 const base::ListValue* list = NULL; | 208 const base::ListValue* list = NULL; |
209 if (!value.GetAsList(&list) || !list || list->empty()) | 209 if (!value.GetAsList(&list) || !list || list->empty()) |
210 return false; | 210 return false; |
211 for (base::ListValue::const_iterator list_it = list->begin(); | 211 for (base::ListValue::const_iterator list_it = list->begin(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 break; | 243 break; |
244 default: | 244 default: |
245 NOTREACHED(); | 245 NOTREACHED(); |
246 return false; | 246 return false; |
247 } | 247 } |
248 | 248 |
249 return true; | 249 return true; |
250 } | 250 } |
251 | 251 |
252 } // namespace net | 252 } // namespace net |
OLD | NEW |