| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // This class is used for managing DevTools remote debugging server. | 25 // This class is used for managing DevTools remote debugging server. |
| 26 // Clients can connect to the specified ip:port and start debugging | 26 // Clients can connect to the specified ip:port and start debugging |
| 27 // this browser. | 27 // this browser. |
| 28 class DevToolsHttpHandler { | 28 class DevToolsHttpHandler { |
| 29 public: | 29 public: |
| 30 | 30 |
| 31 // Factory of net::ServerSocket. This is to separate instantiating dev tools | 31 // Factory of net::ServerSocket. This is to separate instantiating dev tools |
| 32 // and instantiating server socket. | 32 // and instantiating server socket. |
| 33 class CONTENT_EXPORT ServerSocketFactory { | 33 class CONTENT_EXPORT ServerSocketFactory { |
| 34 public: | 34 public: |
| 35 ServerSocketFactory(const std::string& address, int port, int backlog); | 35 ServerSocketFactory(const std::string& address, uint16 port, int backlog); |
| 36 virtual ~ServerSocketFactory(); | 36 virtual ~ServerSocketFactory(); |
| 37 | 37 |
| 38 // Returns a new instance of ServerSocket or NULL if an error occurred. | 38 // Returns a new instance of ServerSocket or NULL if an error occurred. |
| 39 // It calls ServerSocket::ListenWithAddressAndPort() with address, port and | 39 // It calls ServerSocket::ListenWithAddressAndPort() with address, port and |
| 40 // backlog passed to constructor. | 40 // backlog passed to constructor. |
| 41 virtual scoped_ptr<net::ServerSocket> CreateAndListen() const; | 41 virtual scoped_ptr<net::ServerSocket> CreateAndListen() const; |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 // Creates a server socket. ServerSocket::Listen() will be called soon | 44 // Creates a server socket. ServerSocket::Listen() will be called soon |
| 45 // unless it returns NULL. | 45 // unless it returns NULL. |
| 46 virtual scoped_ptr<net::ServerSocket> Create() const = 0; | 46 virtual scoped_ptr<net::ServerSocket> Create() const = 0; |
| 47 | 47 |
| 48 const std::string address_; | 48 const std::string address_; |
| 49 const int port_; | 49 const uint16 port_; |
| 50 const int backlog_; | 50 const int backlog_; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 DISALLOW_COPY_AND_ASSIGN(ServerSocketFactory); | 53 DISALLOW_COPY_AND_ASSIGN(ServerSocketFactory); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 // Returns true if the given protocol version is supported. | 56 // Returns true if the given protocol version is supported. |
| 57 CONTENT_EXPORT static bool IsSupportedProtocolVersion( | 57 CONTENT_EXPORT static bool IsSupportedProtocolVersion( |
| 58 const std::string& version); | 58 const std::string& version); |
| 59 | 59 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 79 // Returns the URL for the address to debug |agent_host|. | 79 // Returns the URL for the address to debug |agent_host|. |
| 80 virtual GURL GetFrontendURL() = 0; | 80 virtual GURL GetFrontendURL() = 0; |
| 81 | 81 |
| 82 protected: | 82 protected: |
| 83 virtual ~DevToolsHttpHandler() {} | 83 virtual ~DevToolsHttpHandler() {} |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace content | 86 } // namespace content |
| 87 | 87 |
| 88 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ | 88 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ |
| OLD | NEW |