Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_protocol_handler.h" | 5 #include "chrome/browser/debugger/devtools_protocol_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
| 9 #include "chrome/browser/debugger/inspectable_tab_proxy.h" | 9 #include "chrome/browser/debugger/inspectable_tab_proxy.h" |
| 10 #include "chrome/browser/debugger/debugger_remote_service.h" | |
| 10 #include "chrome/browser/debugger/devtools_remote_message.h" | 11 #include "chrome/browser/debugger/devtools_remote_message.h" |
| 11 #include "chrome/browser/debugger/devtools_remote_listen_socket.h" | 12 #include "chrome/browser/debugger/devtools_remote_listen_socket.h" |
| 13 #include "chrome/browser/debugger/devtools_remote_service.h" | |
| 14 #include "chrome/browser/debugger/extension_ports_remote_service.h" | |
| 15 | |
| 16 // static | |
| 17 scoped_refptr<DevToolsProtocolHandler> DevToolsProtocolHandler::Start(int port) { | |
|
yurys
2011/01/31 15:20:56
line is too long
| |
| 18 scoped_refptr<DevToolsProtocolHandler> proto_handler = | |
| 19 new DevToolsProtocolHandler(port); | |
| 20 proto_handler->RegisterDestination( | |
| 21 new DevToolsRemoteService(proto_handler), | |
| 22 DevToolsRemoteService::kToolName); | |
| 23 proto_handler->RegisterDestination( | |
| 24 new DebuggerRemoteService(proto_handler), | |
| 25 DebuggerRemoteService::kToolName); | |
| 26 proto_handler->RegisterDestination( | |
| 27 new ExtensionPortsRemoteService(proto_handler), | |
| 28 ExtensionPortsRemoteService::kToolName); | |
| 29 proto_handler->Start(); | |
| 30 return proto_handler; | |
| 31 } | |
| 12 | 32 |
| 13 DevToolsProtocolHandler::DevToolsProtocolHandler(int port) | 33 DevToolsProtocolHandler::DevToolsProtocolHandler(int port) |
| 14 : port_(port), | 34 : port_(port), |
| 15 connection_(NULL), | 35 connection_(NULL), |
| 16 server_(NULL) { | 36 server_(NULL) { |
| 17 inspectable_tab_proxy_.reset(new InspectableTabProxy); | 37 inspectable_tab_proxy_.reset(new InspectableTabProxy); |
| 18 } | 38 } |
| 19 | 39 |
| 20 DevToolsProtocolHandler::~DevToolsProtocolHandler() { | 40 DevToolsProtocolHandler::~DevToolsProtocolHandler() { |
| 21 // Stop() must be called prior to this being called | 41 // Stop() must be called prior to this being called |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 for (ToolToListenerMap::const_iterator it = tool_to_listener_map_.begin(), | 115 for (ToolToListenerMap::const_iterator it = tool_to_listener_map_.begin(), |
| 96 end = tool_to_listener_map_.end(); | 116 end = tool_to_listener_map_.end(); |
| 97 it != end; | 117 it != end; |
| 98 ++it) { | 118 ++it) { |
| 99 BrowserThread::PostTask( | 119 BrowserThread::PostTask( |
| 100 BrowserThread::UI, FROM_HERE, | 120 BrowserThread::UI, FROM_HERE, |
| 101 NewRunnableMethod( | 121 NewRunnableMethod( |
| 102 it->second.get(), &DevToolsRemoteListener::OnConnectionLost)); | 122 it->second.get(), &DevToolsRemoteListener::OnConnectionLost)); |
| 103 } | 123 } |
| 104 } | 124 } |
| OLD | NEW |