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 "content/browser/devtools/devtools_http_handler_impl.h" | 5 #include "content/browser/devtools/devtools_http_handler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 697 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
698 &json_value); | 698 &json_value); |
699 } | 699 } |
700 std::string json_message; | 700 std::string json_message; |
701 scoped_ptr<base::Value> message_object(new base::StringValue(message)); | 701 scoped_ptr<base::Value> message_object(new base::StringValue(message)); |
702 base::JSONWriter::Write(message_object.get(), &json_message); | 702 base::JSONWriter::Write(message_object.get(), &json_message); |
703 | 703 |
704 std::string response; | 704 std::string response; |
705 std::string mime_type = "application/json; charset=UTF-8"; | 705 std::string mime_type = "application/json; charset=UTF-8"; |
706 | 706 |
707 response = StringPrintf("%s%s", json_value.c_str(), message.c_str()); | 707 response = base::StringPrintf("%s%s", json_value.c_str(), message.c_str()); |
708 | 708 |
709 thread_->message_loop()->PostTask( | 709 thread_->message_loop()->PostTask( |
710 FROM_HERE, | 710 FROM_HERE, |
711 base::Bind(&net::HttpServer::Send, | 711 base::Bind(&net::HttpServer::Send, |
712 server_.get(), | 712 server_.get(), |
713 connection_id, | 713 connection_id, |
714 status_code, | 714 status_code, |
715 response, | 715 response, |
716 mime_type)); | 716 mime_type)); |
717 } | 717 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 std::string devtools_frontend_url = GetFrontendURLInternal( | 800 std::string devtools_frontend_url = GetFrontendURLInternal( |
801 id.c_str(), | 801 id.c_str(), |
802 host); | 802 host); |
803 dictionary->SetString("devtoolsFrontendUrl", devtools_frontend_url); | 803 dictionary->SetString("devtoolsFrontendUrl", devtools_frontend_url); |
804 } | 804 } |
805 dictionary->SetString("description", delegate_->GetViewDescription(rvh)); | 805 dictionary->SetString("description", delegate_->GetViewDescription(rvh)); |
806 return dictionary; | 806 return dictionary; |
807 } | 807 } |
808 | 808 |
809 } // namespace content | 809 } // namespace content |
OLD | NEW |