OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 if (!thread_) | 767 if (!thread_) |
768 return; | 768 return; |
769 | 769 |
770 // Serialize value and message. | 770 // Serialize value and message. |
771 std::string json_value; | 771 std::string json_value; |
772 if (value) { | 772 if (value) { |
773 base::JSONWriter::WriteWithOptions( | 773 base::JSONWriter::WriteWithOptions( |
774 *value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json_value); | 774 *value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json_value); |
775 } | 775 } |
776 std::string json_message; | 776 std::string json_message; |
777 base::JSONWriter::Write(base::StringValue(message), &json_message); | 777 base::JSONWriter::Write(base::Value(message), &json_message); |
778 | 778 |
779 net::HttpServerResponseInfo response(status_code); | 779 net::HttpServerResponseInfo response(status_code); |
780 response.SetBody(json_value + message, "application/json; charset=UTF-8"); | 780 response.SetBody(json_value + message, "application/json; charset=UTF-8"); |
781 | 781 |
782 thread_->task_runner()->PostTask( | 782 thread_->task_runner()->PostTask( |
783 FROM_HERE, | 783 FROM_HERE, |
784 base::Bind(&ServerWrapper::SendResponse, | 784 base::Bind(&ServerWrapper::SendResponse, |
785 base::Unretained(server_wrapper_), connection_id, response)); | 785 base::Unretained(server_wrapper_), connection_id, response)); |
786 } | 786 } |
787 | 787 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 id.c_str(), | 856 id.c_str(), |
857 host); | 857 host); |
858 dictionary->SetString( | 858 dictionary->SetString( |
859 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 859 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
860 } | 860 } |
861 | 861 |
862 return dictionary; | 862 return dictionary; |
863 } | 863 } |
864 | 864 |
865 } // namespace content | 865 } // namespace content |
OLD | NEW |