| 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 int connection_id, | 880 int connection_id, |
| 881 const net::HttpServerRequestInfo& request) { | 881 const net::HttpServerRequestInfo& request) { |
| 882 if (!thread_) | 882 if (!thread_) |
| 883 return; | 883 return; |
| 884 thread_->task_runner()->PostTask( | 884 thread_->task_runner()->PostTask( |
| 885 FROM_HERE, | 885 FROM_HERE, |
| 886 base::Bind(&ServerWrapper::AcceptWebSocket, | 886 base::Bind(&ServerWrapper::AcceptWebSocket, |
| 887 base::Unretained(server_wrapper_), connection_id, request)); | 887 base::Unretained(server_wrapper_), connection_id, request)); |
| 888 } | 888 } |
| 889 | 889 |
| 890 base::DictionaryValue* DevToolsHttpHandler::SerializeDescriptor( | 890 std::unique_ptr<base::DictionaryValue> DevToolsHttpHandler::SerializeDescriptor( |
| 891 scoped_refptr<DevToolsAgentHost> agent_host, | 891 scoped_refptr<DevToolsAgentHost> agent_host, |
| 892 const std::string& host) { | 892 const std::string& host) { |
| 893 base::DictionaryValue* dictionary = new base::DictionaryValue; | 893 std::unique_ptr<base::DictionaryValue> dictionary(new base::DictionaryValue); |
| 894 std::string id = agent_host->GetId(); | 894 std::string id = agent_host->GetId(); |
| 895 dictionary->SetString(kTargetIdField, id); | 895 dictionary->SetString(kTargetIdField, id); |
| 896 std::string parent_id = agent_host->GetParentId(); | 896 std::string parent_id = agent_host->GetParentId(); |
| 897 if (!parent_id.empty()) | 897 if (!parent_id.empty()) |
| 898 dictionary->SetString(kTargetParentIdField, parent_id); | 898 dictionary->SetString(kTargetParentIdField, parent_id); |
| 899 dictionary->SetString(kTargetTypeField, agent_host->GetType()); | 899 dictionary->SetString(kTargetTypeField, agent_host->GetType()); |
| 900 dictionary->SetString(kTargetTitleField, | 900 dictionary->SetString(kTargetTitleField, |
| 901 net::EscapeForHTML(agent_host->GetTitle())); | 901 net::EscapeForHTML(agent_host->GetTitle())); |
| 902 dictionary->SetString(kTargetDescriptionField, agent_host->GetDescription()); | 902 dictionary->SetString(kTargetDescriptionField, agent_host->GetDescription()); |
| 903 | 903 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 923 id.c_str(), | 923 id.c_str(), |
| 924 host); | 924 host); |
| 925 dictionary->SetString( | 925 dictionary->SetString( |
| 926 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 926 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
| 927 } | 927 } |
| 928 | 928 |
| 929 return dictionary; | 929 return dictionary; |
| 930 } | 930 } |
| 931 | 931 |
| 932 } // namespace devtools_http_handler | 932 } // namespace devtools_http_handler |
| OLD | NEW |