Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: content/browser/debugger/devtools_http_handler_impl.h

Issue 8554008: Add content API for DevTools HTTP handler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unnecessary comment from the public interface Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/debugger/devtools_http_handler_impl.h
diff --git a/content/browser/debugger/devtools_http_protocol_handler.h b/content/browser/debugger/devtools_http_handler_impl.h
similarity index 59%
rename from content/browser/debugger/devtools_http_protocol_handler.h
rename to content/browser/debugger/devtools_http_handler_impl.h
index c25b5cd03814764c7f73edef21ab8e8d12c32c7d..69ead4058aa363d45ece68be128d7b566d3f79c1 100644
--- a/content/browser/debugger/devtools_http_protocol_handler.h
+++ b/content/browser/debugger/devtools_http_handler_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_PROTOCOL_HANDLER_H_
-#define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_PROTOCOL_HANDLER_H_
+#ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_
+#define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_
#pragma once
#include <map>
@@ -14,65 +14,38 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
+#include "content/public/browser/devtools_http_handler.h"
#include "net/server/http_server.h"
#include "net/url_request/url_request.h"
class TabContents;
-namespace content {
-class DevToolsClientHost;
-}
-
namespace net {
class URLRequestContext;
}
-class DevToolsHttpProtocolHandler
- : public net::HttpServer::Delegate,
- public net::URLRequest::Delegate,
- public base::RefCountedThreadSafe<DevToolsHttpProtocolHandler> {
- public:
- typedef std::vector<TabContents*> InspectableTabs;
- class Delegate {
- public:
- Delegate() {}
- virtual ~Delegate() {}
-
- // Should return the list of inspectable tabs. Called on the UI thread.
- virtual InspectableTabs GetInspectableTabs() = 0;
-
- // Should return discovery page HTML that should list available tabs
- // and provide attach links. Called on the IO thread.
- virtual std::string GetDiscoveryPageHTML() = 0;
-
- // Should return URL request context for issuing requests against devtools
- // webui or NULL if no context is available. Called on the IO thread.
- virtual net::URLRequestContext* GetURLRequestContext() = 0;
- private:
- DISALLOW_COPY_AND_ASSIGN(Delegate);
- };
-
- // Takes ownership over |delegate|.
- CONTENT_EXPORT static scoped_refptr<DevToolsHttpProtocolHandler> Start(
- const std::string& ip,
- int port,
- const std::string& frontend_url,
- Delegate* delegate);
-
- // Called from the main thread in order to stop protocol handler.
- // Will schedule tear down task on IO thread.
- CONTENT_EXPORT void Stop();
+namespace content {
+
+class DevToolsClientHost;
+class DevToolsHttpHandlerImpl
+ : public DevToolsHttpHandler,
+ public base::RefCountedThreadSafe<DevToolsHttpHandlerImpl>,
+ public net::HttpServer::Delegate,
+ public net::URLRequest::Delegate {
private:
- friend class base::RefCountedThreadSafe<DevToolsHttpProtocolHandler>;
-
- DevToolsHttpProtocolHandler(const std::string& ip,
- int port,
- const std::string& frontend_url,
- Delegate* delegate);
- virtual ~DevToolsHttpProtocolHandler();
+ friend class base::RefCountedThreadSafe<DevToolsHttpHandlerImpl>;
+ friend class DevToolsHttpHandler;
+ DevToolsHttpHandlerImpl(const std::string& ip,
+ int port,
+ const std::string& frontend_url,
+ DevToolsHttpHandlerDelegate* delegate);
+ virtual ~DevToolsHttpHandlerImpl();
void Start();
+ // DevToolsHttpHandler implementation.
+ virtual void Stop() OVERRIDE;
+
// net::HttpServer::Delegate implementation.
virtual void OnHttpRequest(int connection_id,
const net::HttpServerRequestInfo& info) OVERRIDE;
@@ -126,8 +99,11 @@ class DevToolsHttpProtocolHandler
typedef std::map<int, content::DevToolsClientHost*>
ConnectionToClientHostMap;
ConnectionToClientHostMap connection_to_client_host_ui_;
- scoped_ptr<Delegate> delegate_;
- DISALLOW_COPY_AND_ASSIGN(DevToolsHttpProtocolHandler);
+ scoped_ptr<DevToolsHttpHandlerDelegate> delegate_;
+ scoped_refptr<DevToolsHttpHandlerImpl> protect_ptr_;
+ DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandlerImpl);
};
-#endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_PROTOCOL_HANDLER_H_
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_HTTP_HANDLER_IMPL_H_
« no previous file with comments | « chrome/browser/debugger/remote_debugging_server.cc ('k') | content/browser/debugger/devtools_http_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698