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.
5 #ifndef XWALK_RUNTIME_BROWSER_ANDROID_XWALK_DEV_TOOLS_SERVER_H_
6 #define XWALK_RUNTIME_BROWSER_ANDROID_XWALK_DEV_TOOLS_SERVER_H_
10 #include "base/basictypes.h"
11 #include "net/socket/unix_domain_server_socket_posix.h"
14 class DevToolsHttpHandler;
19 // This class controls Developer Tools remote debugging server.
20 class XWalkDevToolsServer {
22 explicit XWalkDevToolsServer(const std::string& socket_name);
23 ~XWalkDevToolsServer();
25 // Opens linux abstract socket to be ready for remote debugging.
26 void Start(bool allow_debug_permission);
28 // Closes debugging socket, stops debugging.
31 bool IsStarted() const;
33 void AllowConnectionFromUid(uid_t uid);
36 bool CanUserConnectToDevTools(
37 const net::UnixDomainServerSocket::Credentials& credentials);
39 std::string socket_name_;
40 content::DevToolsHttpHandler* protocol_handler_;
43 DISALLOW_COPY_AND_ASSIGN(XWalkDevToolsServer);
46 bool RegisterXWalkDevToolsServer(JNIEnv* env);
50 #endif // XWALK_RUNTIME_BROWSER_ANDROID_XWALK_DEV_TOOLS_SERVER_H_