Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / devtools / remote_debugging_server.cc
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
3 // found in the LICENSE file.
4
5 #include "xwalk/runtime/browser/devtools/remote_debugging_server.h"
6
7 #include "xwalk/runtime/browser/devtools/xwalk_devtools_delegate.h"
8 #include "xwalk/runtime/browser/runtime_context.h"
9 #include "content/public/browser/devtools_http_handler.h"
10 #include "net/socket/tcp_listen_socket.h"
11
12 namespace xwalk {
13
14 RemoteDebuggingServer::RemoteDebuggingServer(
15     RuntimeContext* runtime_context,
16     const std::string& ip,
17     int port,
18     const std::string& frontend_url) {
19   devtools_http_handler_ = content::DevToolsHttpHandler::Start(
20       new net::TCPListenSocketFactory(ip, port),
21       frontend_url,
22       new XWalkDevToolsDelegate(runtime_context));
23 }
24
25 RemoteDebuggingServer::~RemoteDebuggingServer() {
26   devtools_http_handler_->Stop();
27 }
28
29 }  // namespace xwalk