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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_
10 #include "content/common/content_export.h"
15 class StreamListenSocketFactory;
16 class URLRequestContextGetter;
21 class DevToolsHttpHandlerDelegate;
23 // This class is used for managing DevTools remote debugging server.
24 // Clients can connect to the specified ip:port and start debugging
26 class DevToolsHttpHandler {
28 // Returns true if the given protocol version is supported.
29 CONTENT_EXPORT static bool IsSupportedProtocolVersion(
30 const std::string& version);
32 // Returns frontend resource id for the given resource |name|.
33 CONTENT_EXPORT static int GetFrontendResourceId(
34 const std::string& name);
36 // Takes ownership over |socket_factory| and |delegate|.
37 CONTENT_EXPORT static DevToolsHttpHandler* Start(
38 const net::StreamListenSocketFactory* socket_factory,
39 const std::string& frontend_url,
40 DevToolsHttpHandlerDelegate* delegate);
42 // Called from the main thread in order to stop protocol handler.
43 // Automatically destroys the handler instance.
44 virtual void Stop() = 0;
46 // Returns the URL for the address to debug |agent_host|.
47 virtual GURL GetFrontendURL() = 0;
50 virtual ~DevToolsHttpHandler() {}
53 } // namespace content
55 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_