| OLD | NEW |
| (Empty) |
| 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 | |
| 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 namespace chromeos { | |
| 14 | |
| 15 class WebSocketProxy { | |
| 16 public: | |
| 17 static const size_t kBufferLimit = 12 * 1024 * 1024; | |
| 18 | |
| 19 // Limits incoming websocket headers in initial stage of connection. | |
| 20 static const size_t kHeaderLimit = 32 * 1024; | |
| 21 | |
| 22 // Limits number of simultaneously open connections. | |
| 23 static const size_t kConnPoolLimit = 40; | |
| 24 | |
| 25 WebSocketProxy(); | |
| 26 ~WebSocketProxy(); | |
| 27 | |
| 28 // Do not call it twice. | |
| 29 void Run(); | |
| 30 | |
| 31 // Terminates running server (should be called on a different thread). | |
| 32 void Shutdown(); | |
| 33 | |
| 34 // Call this on network change. | |
| 35 void OnNetworkChange(); | |
| 36 | |
| 37 private: | |
| 38 void* impl_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(WebSocketProxy); | |
| 41 }; | |
| 42 | |
| 43 } // namespace chromeos | |
| 44 | |
| 45 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_ | |
| OLD | NEW |