Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/chromeos/web_socket_proxy.h

Issue 6683060: Private API for extensions like ssh-client that need access to TCP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_
6 #define CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_ 6 #define CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 12
13 struct sockaddr; 13 struct sockaddr;
14 14
15 namespace chromeos { 15 namespace chromeos {
16 16
17 class WebSocketProxy { 17 class WebSocketProxy {
18 public: 18 public:
19 static const size_t kReadBufferLimit = 6 * 1024 * 1024; 19 static const size_t kReadBufferLimit = 12 * 1024 * 1024;
20 20
21 // Limits incoming websocket headers in initial stage of connection. 21 // Limits incoming websocket headers in initial stage of connection.
22 static const size_t kHeaderLimit = 32 * 1024; 22 static const size_t kHeaderLimit = 32 * 1024;
23 23
24 // Limits number of simultaneously open connections. 24 // Limits number of simultaneously open connections.
25 static const size_t kConnPoolLimit = 1000; 25 static const size_t kConnPoolLimit = 200;
Dmitry Polukhin 2011/05/17 10:58:39 I think it should be even much smaller 20.
Denis Lagno 2011/05/17 22:15:08 Done.
26 26
27 // Empty allowed_origins vector disables check for origin.
27 WebSocketProxy( 28 WebSocketProxy(
28 const std::vector<std::string>& allowed_origins, 29 const std::vector<std::string>& allowed_origins,
29 struct sockaddr* addr, int addr_len); 30 struct sockaddr* addr, int addr_len);
30 ~WebSocketProxy(); 31 ~WebSocketProxy();
31 32
32 // Do not call it twice. 33 // Do not call it twice.
33 void Run(); 34 void Run();
34 35
35 // Terminates running server (should be called on a different thread). 36 // Terminates running server (should be called on a different thread).
36 void Shutdown(); 37 void Shutdown();
37 38
38 private: 39 private:
39 void* impl_; 40 void* impl_;
40 41
41 DISALLOW_COPY_AND_ASSIGN(WebSocketProxy); 42 DISALLOW_COPY_AND_ASSIGN(WebSocketProxy);
42 }; 43 };
43 44
44 } // namespace chromeos 45 } // namespace chromeos
45 46
46 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_ 47 #endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/web_socket_proxy.cc » ('j') | chrome/browser/chromeos/web_socket_proxy_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698