Chromium Code Reviews| 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..16815e0dfa7f5bd477776143883507cd12229839 100644 |
| --- a/sky/services/inspector/inspector_frontend_impl.h |
| +++ b/sky/services/inspector/inspector_frontend_impl.h |
| @@ -14,42 +14,32 @@ |
| namespace sky { |
| namespace inspector { |
| -class InspectorFrontendImpl : public mojo::InterfaceImpl<InspectorFrontend>, |
| - public net::HttpServer::Delegate { |
| +class InspectorFrontendImpl : public mojo::InterfaceImpl<InspectorFrontend> { |
|
Aaron Boodman
2014/11/11 16:12:50
I find that it makes implementation easier to put
|
| public: |
| - InspectorFrontendImpl(); |
| + class Delegate { |
| + public: |
| + virtual void Register(InspectorFrontendImpl*) = 0; |
|
Aaron Boodman
2014/11/11 16:12:50
You can avoid the Register() function by just havi
|
| + virtual void Unregister(InspectorFrontendImpl*) = 0; |
| + virtual void SendMessage(const mojo::String&) = 0; |
| + }; |
| + |
| + InspectorFrontendImpl(Delegate* delegate); |
|
abarth-chromium
2014/11/11 02:53:57
explicit
|
| 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 OnShutdown(); |
| - void StopListening(); |
| + private: |
| + // InspectorFrontend: |
| + void SendMessage(const mojo::String& message) override; |
| - void Register(int port); |
| - void Unregister(); |
| + // InterfaceImpl: |
| + void OnConnectionError() override; |
| - 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 |