| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_SPY_WEBSOCKET_SERVER_H_ | 5 #ifndef MOJO_SPY_WEBSOCKET_SERVER_H_ |
| 6 #define MOJO_SPY_WEBSOCKET_SERVER_H_ | 6 #define MOJO_SPY_WEBSOCKET_SERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "mojo/spy/common.h" | 10 #include "mojo/spy/common.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 int port() const { return port_; } | 31 int port() const { return port_; } |
| 32 | 32 |
| 33 // Maintains a log of the message passed in. | 33 // Maintains a log of the message passed in. |
| 34 void LogMessageInfo( | 34 void LogMessageInfo( |
| 35 const mojo::MojoRequestHeader& message_header, | 35 const mojo::MojoRequestHeader& message_header, |
| 36 const GURL& url, | 36 const GURL& url, |
| 37 const base::Time& message_time); | 37 const base::Time& message_time); |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 // Overridden from net::HttpServer::Delegate. | 40 // Overridden from net::HttpServer::Delegate. |
| 41 virtual void OnConnect(int connection_id) OVERRIDE {} |
| 41 virtual void OnHttpRequest( | 42 virtual void OnHttpRequest( |
| 42 int connection_id, | 43 int connection_id, |
| 43 const net::HttpServerRequestInfo& info) OVERRIDE; | 44 const net::HttpServerRequestInfo& info) OVERRIDE; |
| 44 virtual void OnWebSocketRequest( | 45 virtual void OnWebSocketRequest( |
| 45 int connection_id, | 46 int connection_id, |
| 46 const net::HttpServerRequestInfo& info) OVERRIDE; | 47 const net::HttpServerRequestInfo& info) OVERRIDE; |
| 47 virtual void OnWebSocketMessage( | 48 virtual void OnWebSocketMessage( |
| 48 int connection_id, | 49 int connection_id, |
| 49 const std::string& data) OVERRIDE; | 50 const std::string& data) OVERRIDE; |
| 50 virtual void OnClose(int connection_id) OVERRIDE; | 51 virtual void OnClose(int connection_id) OVERRIDE; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 68 int connection_id_; | 69 int connection_id_; |
| 69 scoped_ptr<net::HttpServer> web_server_; | 70 scoped_ptr<net::HttpServer> web_server_; |
| 70 spy_api::SpyServerPtr spy_server_; | 71 spy_api::SpyServerPtr spy_server_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(WebSocketServer); | 73 DISALLOW_COPY_AND_ASSIGN(WebSocketServer); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace mojo | 76 } // namespace mojo |
| 76 | 77 |
| 77 #endif // MOJO_SPY_WEBSOCKET_SERVER_H_ | 78 #endif // MOJO_SPY_WEBSOCKET_SERVER_H_ |
| OLD | NEW |