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

Unified Diff: sky/services/inspector/inspector_frontend_impl.h

Issue 710043004: Make it possible to have multiple InspectorBackends (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Actually works Created 6 years, 1 month 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
« no previous file with comments | « no previous file | sky/services/inspector/inspector_frontend_impl.cc » ('j') | sky/services/inspector/server.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/services/inspector/inspector_frontend_impl.h
diff --git a/sky/services/inspector/inspector_frontend_impl.h b/sky/services/inspector/inspector_frontend_impl.h
index 6521760351bcdf3178de391a1ceb3b18037ceb63..f16ae87cc71f02a1975e45bb20368db8cacefd81 100644
--- a/sky/services/inspector/inspector_frontend_impl.h
+++ b/sky/services/inspector/inspector_frontend_impl.h
@@ -14,42 +14,30 @@
namespace sky {
namespace inspector {
-class InspectorFrontendImpl : public mojo::InterfaceImpl<InspectorFrontend>,
- public net::HttpServer::Delegate {
+class InspectorFrontendImpl : public mojo::InterfaceImpl<InspectorFrontend> {
public:
- InspectorFrontendImpl();
+ class Delegate {
+ public:
+ virtual void Register(InspectorFrontendImpl*) = 0;
+ virtual void Unregister(InspectorFrontendImpl*) = 0;
+
+ virtual void Listen(int32_t port) = 0;
+ virtual void SendMessage(const mojo::String&) = 0;
+ };
+
+ InspectorFrontendImpl(Delegate* delegate);
virtual ~InspectorFrontendImpl();
private:
- // From net::HttpServer::Delegate
- virtual void OnConnect(int connection_id) override;
- virtual void OnHttpRequest(
- int connection_id, const net::HttpServerRequestInfo& info) override;
- virtual void OnWebSocketRequest(
- int connection_id, const net::HttpServerRequestInfo& info) override;
- virtual void OnWebSocketMessage(
- int connection_id, const std::string& data) override;
- virtual void OnClose(int connection_id) override;
-
// From InspectorFrontend
- virtual void Listen(int32_t port) override;
- virtual void SendMessage(const mojo::String&) override;
+ void Listen(int32_t port) override;
+ void SendMessage(const mojo::String& message) override;
- void StopListening();
-
- void Register(int port);
- void Unregister();
-
- int port_;
- int connection_id_;
- scoped_ptr<net::HttpServer> web_server_;
+ Delegate* delegate_;
MOJO_DISALLOW_COPY_AND_ASSIGN(InspectorFrontendImpl);
};
-typedef mojo::InterfaceFactoryImpl<
- InspectorFrontendImpl> InspectorFrontendFactory;
-
} // namespace tester
} // namespace sky
« no previous file with comments | « no previous file | sky/services/inspector/inspector_frontend_impl.cc » ('j') | sky/services/inspector/server.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698