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_agent_host_impl.h" | 5 #include "content/browser/devtools/devtools_agent_host_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 if (!command) | 235 if (!command) |
236 return true; | 236 return true; |
237 | 237 |
238 DevToolsManagerDelegate* delegate = | 238 DevToolsManagerDelegate* delegate = |
239 DevToolsManager::GetInstance()->delegate(); | 239 DevToolsManager::GetInstance()->delegate(); |
240 if (delegate) { | 240 if (delegate) { |
241 scoped_ptr<base::DictionaryValue> response( | 241 scoped_ptr<base::DictionaryValue> response( |
242 delegate->HandleCommand(this, command.get())); | 242 delegate->HandleCommand(this, command.get())); |
243 if (response) { | 243 if (response) { |
244 std::string json_response; | 244 std::string json_response; |
245 base::JSONWriter::Write(response.get(), &json_response); | 245 base::JSONWriter::Write(*response, &json_response); |
246 SendMessageToClient(json_response); | 246 SendMessageToClient(json_response); |
247 return true; | 247 return true; |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 if (!handle_all_commands_) | 251 if (!handle_all_commands_) |
252 return protocol_handler_->HandleOptionalCommand(command.Pass()); | 252 return protocol_handler_->HandleOptionalCommand(command.Pass()); |
253 protocol_handler_->HandleCommand(command.Pass()); | 253 protocol_handler_->HandleCommand(command.Pass()); |
254 return true; | 254 return true; |
255 } | 255 } |
256 | 256 |
257 } // namespace content | 257 } // namespace content |
OLD | NEW |