| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/debugger/debugger_wrapper.h" | |
| 6 | |
| 7 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" | |
| 8 #include "chrome/browser/debugger/debugger_remote_service.h" | |
| 9 #include "chrome/browser/debugger/devtools_protocol_handler.h" | |
| 10 #include "chrome/browser/debugger/devtools_remote_service.h" | |
| 11 #include "chrome/browser/debugger/extension_ports_remote_service.h" | |
| 12 | |
| 13 DebuggerWrapper::DebuggerWrapper(int port, bool useHttp) { | |
| 14 if (port > 0) { | |
| 15 if (useHttp) { | |
| 16 http_handler_ = new DevToolsHttpProtocolHandler(port); | |
| 17 http_handler_->Start(); | |
| 18 } else { | |
| 19 proto_handler_ = 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 } | |
| 31 } | |
| 32 } | |
| 33 | |
| 34 DebuggerWrapper::~DebuggerWrapper() { | |
| 35 if (proto_handler_.get() != NULL) | |
| 36 proto_handler_->Stop(); | |
| 37 | |
| 38 if (http_handler_.get() != NULL) | |
| 39 http_handler_->Stop(); | |
| 40 } | |
| OLD | NEW |