OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 struct sockaddr; |
| 14 |
| 15 namespace chromeos { |
| 16 |
| 17 class WebSocketProxy { |
| 18 public: |
| 19 static const size_t kReadBufferLimit = 6 * 1024 * 1024; |
| 20 |
| 21 // Limits incoming websocket headers in initial stage of connection. |
| 22 static const size_t kHeaderLimit = 32 * 1024; |
| 23 |
| 24 // Limits number of simultaneously open connections. |
| 25 static const size_t kConnPoolLimit = 1000; |
| 26 |
| 27 WebSocketProxy( |
| 28 const std::vector<std::string>& allowed_origins, |
| 29 struct sockaddr* addr, int addr_len); |
| 30 ~WebSocketProxy(); |
| 31 |
| 32 // Do not call it twice. |
| 33 void Run(); |
| 34 |
| 35 // Terminates running server (should be called on a different thread). |
| 36 void Shutdown(); |
| 37 |
| 38 private: |
| 39 void* impl_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(WebSocketProxy); |
| 42 }; |
| 43 |
| 44 } // namespace chromeos |
| 45 |
| 46 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_ |
OLD | NEW |