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

Side by Side Diff: chrome/browser/debugger/devtools_http_protocol_handler.cc

Issue 3052019: DevTools: restore remote rebugging after upstream breakage. (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/debugger/devtools_http_protocol_handler.h" 5 #include "chrome/browser/debugger/devtools_http_protocol_handler.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 socket_to_client_host_ui_[socket] = client_host; 239 socket_to_client_host_ui_[socket] = client_host;
240 240
241 manager->RegisterDevToolsClientHostFor( 241 manager->RegisterDevToolsClientHostFor(
242 tab_contents->render_view_host(), 242 tab_contents->render_view_host(),
243 client_host); 243 client_host);
244 AcceptWebSocket(socket, request); 244 AcceptWebSocket(socket, request);
245 } 245 }
246 246
247 void DevToolsHttpProtocolHandler::OnWebSocketMessageUI( 247 void DevToolsHttpProtocolHandler::OnWebSocketMessageUI(
248 HttpListenSocket* socket, 248 HttpListenSocket* socket,
249 const std::string& d) { 249 const std::string& data) {
250 SocketToClientHostMap::iterator it = socket_to_client_host_ui_.find(socket); 250 SocketToClientHostMap::iterator it = socket_to_client_host_ui_.find(socket);
251 if (it == socket_to_client_host_ui_.end()) 251 if (it == socket_to_client_host_ui_.end())
252 return; 252 return;
253 253
254 std::string data = d;
255 // TODO(pfeldman): Replace with proper parsing / dispatching. 254 // TODO(pfeldman): Replace with proper parsing / dispatching.
256 DevToolsMessageData message_data; 255 DevToolsMessageData message_data;
257 message_data.class_name = "ToolsAgent"; 256 message_data.class_name = "ToolsAgent";
258 message_data.method_name = "dispatchOnInspectorController"; 257 message_data.method_name = "dispatchOnInspectorController";
259
260 size_t pos = data.find(" ");
261 message_data.arguments.push_back(data.substr(0, pos));
262 data = data.substr(pos + 1);
263
264 message_data.arguments.push_back(data); 258 message_data.arguments.push_back(data);
265 259
266 DevToolsManager* manager = DevToolsManager::GetInstance(); 260 DevToolsManager* manager = DevToolsManager::GetInstance();
267 manager->ForwardToDevToolsAgent(it->second, 261 manager->ForwardToDevToolsAgent(it->second,
268 DevToolsAgentMsg_RpcMessage(DevToolsMessageData(message_data))); 262 DevToolsAgentMsg_RpcMessage(DevToolsMessageData(message_data)));
269 } 263 }
270 264
271 void DevToolsHttpProtocolHandler::OnCloseUI(HttpListenSocket* socket) { 265 void DevToolsHttpProtocolHandler::OnCloseUI(HttpListenSocket* socket) {
272 SocketToClientHostMap::iterator it = socket_to_client_host_ui_.find(socket); 266 SocketToClientHostMap::iterator it = socket_to_client_host_ui_.find(socket);
273 if (it == socket_to_client_host_ui_.end()) 267 if (it == socket_to_client_host_ui_.end())
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 TabStripModel* model = (*it)->tabstrip_model(); 411 TabStripModel* model = (*it)->tabstrip_model();
418 for (int i = 0, size = model->count(); i < size; ++i) { 412 for (int i = 0, size = model->count(); i < size; ++i) {
419 NavigationController& controller = 413 NavigationController& controller =
420 model->GetTabContentsAt(i)->controller(); 414 model->GetTabContentsAt(i)->controller();
421 if (controller.session_id().id() == session_id) 415 if (controller.session_id().id() == session_id)
422 return controller.tab_contents(); 416 return controller.tab_contents();
423 } 417 }
424 } 418 }
425 return NULL; 419 return NULL;
426 } 420 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698