Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(872)

Side by Side Diff: content/browser/devtools/devtools_agent_host_impl.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698