OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/test_server.h" | 5 #include "net/test/test_server.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 LOG(ERROR) << "Could not parse server data: " | 390 LOG(ERROR) << "Could not parse server data: " |
391 << json_reader.GetErrorMessage(); | 391 << json_reader.GetErrorMessage(); |
392 return false; | 392 return false; |
393 } | 393 } |
394 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get()); | 394 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get()); |
395 int port = 0; | 395 int port = 0; |
396 if (!dict->GetInteger("port", &port)) { | 396 if (!dict->GetInteger("port", &port)) { |
397 LOG(ERROR) << "Could not find port value"; | 397 LOG(ERROR) << "Could not find port value"; |
398 return false; | 398 return false; |
399 } | 399 } |
400 if ((port <= 0) || (port >= kuint16max)) { | 400 if ((port <= 0) || (port > kuint16max)) { |
401 LOG(ERROR) << "Invalid port value: " << port; | 401 LOG(ERROR) << "Invalid port value: " << port; |
402 return false; | 402 return false; |
403 } | 403 } |
404 host_port_pair_.set_port(port); | 404 host_port_pair_.set_port(port); |
405 return true; | 405 return true; |
406 } | 406 } |
407 | 407 |
408 } // namespace net | 408 } // namespace net |
OLD | NEW |