OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 namespace chromeos { | 11 namespace chromeos { |
10 | 12 |
11 // Controls webproxy to TCP service. | 13 // Controls webproxy to TCP service. |
12 class WebSocketProxyController { | 14 class WebSocketProxyController { |
13 public: | 15 public: |
| 16 enum ConnectionFlags { |
| 17 PLAIN_TCP = 0, |
| 18 TLS_OVER_TCP = 1 << 0 |
| 19 }; |
| 20 |
14 // Can be called on any thread. Subsequent calls are cheap and do nothing. | 21 // Can be called on any thread. Subsequent calls are cheap and do nothing. |
15 static void Initiate(); | 22 static void Initiate(); |
16 | 23 |
17 // All methods can be called on any thread. | 24 // All methods can be called on any thread. |
18 static void Shutdown(); | 25 static void Shutdown(); |
19 static bool IsInitiated(); | 26 static bool IsInitiated(); |
| 27 |
| 28 static bool CheckCredentials( |
| 29 const std::string& extension_id, |
| 30 const std::string& hostname, |
| 31 unsigned short port, |
| 32 ConnectionFlags); |
20 }; | 33 }; |
21 | 34 |
22 } // namespace chromeos | 35 } // namespace chromeos |
23 | 36 |
24 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_ | 37 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_CONTROLLER_H_ |
OLD | NEW |