| 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_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // socket_factory was initialized with an ephemeral port (0). The | 49 // socket_factory was initialized with an ephemeral port (0). The |
| 50 // port selected by the OS will be written to a well-known file in | 50 // port selected by the OS will be written to a well-known file in |
| 51 // the output directory. | 51 // the output directory. |
| 52 DevToolsHttpHandler( | 52 DevToolsHttpHandler( |
| 53 DevToolsManagerDelegate* delegate, | 53 DevToolsManagerDelegate* delegate, |
| 54 std::unique_ptr<DevToolsSocketFactory> server_socket_factory, | 54 std::unique_ptr<DevToolsSocketFactory> server_socket_factory, |
| 55 const std::string& frontend_url, | 55 const std::string& frontend_url, |
| 56 const base::FilePath& active_port_output_directory, | 56 const base::FilePath& active_port_output_directory, |
| 57 const base::FilePath& debug_frontend_dir, | 57 const base::FilePath& debug_frontend_dir, |
| 58 const std::string& product_name, | 58 const std::string& product_name, |
| 59 const std::string& user_agent); | 59 const std::string& user_agent, |
| 60 const std::string& v8_version); |
| 60 ~DevToolsHttpHandler(); | 61 ~DevToolsHttpHandler(); |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 friend class ServerWrapper; | 64 friend class ServerWrapper; |
| 64 friend void ServerStartedOnUI( | 65 friend void ServerStartedOnUI( |
| 65 base::WeakPtr<DevToolsHttpHandler> handler, | 66 base::WeakPtr<DevToolsHttpHandler> handler, |
| 66 base::Thread* thread, | 67 base::Thread* thread, |
| 67 ServerWrapper* server_wrapper, | 68 ServerWrapper* server_wrapper, |
| 68 DevToolsSocketFactory* socket_factory, | 69 DevToolsSocketFactory* socket_factory, |
| 69 std::unique_ptr<net::IPEndPoint> ip_address); | 70 std::unique_ptr<net::IPEndPoint> ip_address); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 108 |
| 108 std::unique_ptr<base::DictionaryValue> SerializeDescriptor( | 109 std::unique_ptr<base::DictionaryValue> SerializeDescriptor( |
| 109 scoped_refptr<DevToolsAgentHost> agent_host, | 110 scoped_refptr<DevToolsAgentHost> agent_host, |
| 110 const std::string& host); | 111 const std::string& host); |
| 111 | 112 |
| 112 // The thread used by the devtools handler to run server socket. | 113 // The thread used by the devtools handler to run server socket. |
| 113 base::Thread* thread_; | 114 base::Thread* thread_; |
| 114 std::string frontend_url_; | 115 std::string frontend_url_; |
| 115 std::string product_name_; | 116 std::string product_name_; |
| 116 std::string user_agent_; | 117 std::string user_agent_; |
| 118 std::string v8_version_; |
| 117 ServerWrapper* server_wrapper_; | 119 ServerWrapper* server_wrapper_; |
| 118 std::unique_ptr<net::IPEndPoint> server_ip_address_; | 120 std::unique_ptr<net::IPEndPoint> server_ip_address_; |
| 119 using ConnectionToClientMap = | 121 using ConnectionToClientMap = |
| 120 std::map<int, std::unique_ptr<DevToolsAgentHostClientImpl>>; | 122 std::map<int, std::unique_ptr<DevToolsAgentHostClientImpl>>; |
| 121 ConnectionToClientMap connection_to_client_; | 123 ConnectionToClientMap connection_to_client_; |
| 122 DevToolsManagerDelegate* delegate_; | 124 DevToolsManagerDelegate* delegate_; |
| 123 DevToolsSocketFactory* socket_factory_; | 125 DevToolsSocketFactory* socket_factory_; |
| 124 using DescriptorMap = | 126 using DescriptorMap = |
| 125 std::map<std::string, scoped_refptr<DevToolsAgentHost>>; | 127 std::map<std::string, scoped_refptr<DevToolsAgentHost>>; |
| 126 DescriptorMap agent_host_map_; | 128 DescriptorMap agent_host_map_; |
| 127 base::WeakPtrFactory<DevToolsHttpHandler> weak_factory_; | 129 base::WeakPtrFactory<DevToolsHttpHandler> weak_factory_; |
| 128 | 130 |
| 129 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandler); | 131 DISALLOW_COPY_AND_ASSIGN(DevToolsHttpHandler); |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 } // namespace content | 134 } // namespace content |
| 133 | 135 |
| 134 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ | 136 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_HTTP_HANDLER_H_ |
| OLD | NEW |