Chromium Code Reviews| Index: content/public/browser/android/devtools_server.h |
| diff --git a/content/public/browser/android/devtools_server.h b/content/public/browser/android/devtools_server.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f9a0effde8a6819f8423fabd478cffb461aa339 |
| --- /dev/null |
| +++ b/content/public/browser/android/devtools_server.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ |
| +#define CONTENT_PUBLIC_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/callback_forward.h" |
| + |
| +namespace net { |
| +class URLRequestContextGetter; |
| +} |
| + |
| +namespace content { |
| + |
| +class DevToolsHttpHandlerDelegate; |
| + |
| +// This class controls Chrome Developer Tools remote debugging server. |
|
jam
2012/07/11 15:19:22
nit: remove the "Chrome"
Philippe
2012/07/11 15:48:05
Done.
|
| +class DevToolsServer { |
| + public: |
| + // A callback being called each time the server restarts. |
| + // The delegate instance is deleted on server stop, so the creator must |
| + // provide the new instance on each call. |
| + typedef base::Callback<content::DevToolsHttpHandlerDelegate*(void)> |
| + DelegateCreator; |
| + |
| + // Returns the singleton instance (and initializes it if necessary). |
| + static DevToolsServer* GetInstance(); |
| + |
| + // Initializes the server. Must be called prior to the first call of |Start|. |
| + virtual void Init(const std::string& frontend_version, |
| + net::URLRequestContextGetter* url_request_context, |
| + const DelegateCreator& delegate_creator) = 0; |
| + |
| + // Opens linux abstract socket to be ready for remote debugging. |
| + virtual void Start() = 0; |
| + |
| + // Closes debugging socket, stops debugging. |
| + virtual void Stop() = 0; |
| + |
| + virtual bool is_initialized() const = 0; |
|
jam
2012/07/11 15:19:22
for this and below, see the google style guide on
Philippe
2012/07/11 15:48:05
Done.
|
| + |
| + virtual bool is_started() const = 0; |
| + |
| + protected: |
| + // Obtain an instance via GetInstance(). |
| + DevToolsServer() {} |
|
jam
2012/07/11 15:19:22
i don't think you need this
Philippe
2012/07/11 15:48:05
Right. The client can't instantiate this class any
|
| + virtual ~DevToolsServer() {} |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ |