| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/test/chromedriver/server/http_handler.h" | 5 #include "chrome/test/chromedriver/server/http_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 if (status.IsError()) { | 747 if (status.IsError()) { |
| 748 Status full_status(status); | 748 Status full_status(status); |
| 749 full_status.AddDetails(base::StringPrintf( | 749 full_status.AddDetails(base::StringPrintf( |
| 750 "Driver info: chromedriver=%s,platform=%s %s %s", | 750 "Driver info: chromedriver=%s,platform=%s %s %s", |
| 751 kChromeDriverVersion, | 751 kChromeDriverVersion, |
| 752 base::SysInfo::OperatingSystemName().c_str(), | 752 base::SysInfo::OperatingSystemName().c_str(), |
| 753 base::SysInfo::OperatingSystemVersion().c_str(), | 753 base::SysInfo::OperatingSystemVersion().c_str(), |
| 754 base::SysInfo::OperatingSystemArchitecture().c_str())); | 754 base::SysInfo::OperatingSystemArchitecture().c_str())); |
| 755 std::unique_ptr<base::DictionaryValue> error(new base::DictionaryValue()); | 755 std::unique_ptr<base::DictionaryValue> error(new base::DictionaryValue()); |
| 756 error->SetString("message", full_status.message()); | 756 error->SetString("message", full_status.message()); |
| 757 value.reset(error.release()); | 757 value = std::move(error); |
| 758 } | 758 } |
| 759 if (!value) | 759 if (!value) |
| 760 value = base::MakeUnique<base::Value>(); | 760 value = base::MakeUnique<base::Value>(); |
| 761 | 761 |
| 762 base::DictionaryValue body_params; | 762 base::DictionaryValue body_params; |
| 763 body_params.SetInteger("status", status.code()); | 763 body_params.SetInteger("status", status.code()); |
| 764 body_params.Set("value", value.release()); | 764 body_params.Set("value", value.release()); |
| 765 body_params.SetString("sessionId", session_id); | 765 body_params.SetString("sessionId", session_id); |
| 766 std::string body; | 766 std::string body; |
| 767 base::JSONWriter::WriteWithOptions( | 767 base::JSONWriter::WriteWithOptions( |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 params.SetString(name, decoded); | 904 params.SetString(name, decoded); |
| 905 } else if (command_path_parts[i] != path_parts[i]) { | 905 } else if (command_path_parts[i] != path_parts[i]) { |
| 906 return false; | 906 return false; |
| 907 } | 907 } |
| 908 } | 908 } |
| 909 out_params->MergeDictionary(¶ms); | 909 out_params->MergeDictionary(¶ms); |
| 910 return true; | 910 return true; |
| 911 } | 911 } |
| 912 | 912 |
| 913 } // namespace internal | 913 } // namespace internal |
| OLD | NEW |