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

Unified Diff: chrome/browser/chromeos/web_socket_proxy.h

Issue 6801008: Websocket to TCP proxy running in a separate thread (only on ChromeOS). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase+minor 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/chromeos/web_socket_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/web_socket_proxy.h
diff --git a/chrome/browser/chromeos/web_socket_proxy.h b/chrome/browser/chromeos/web_socket_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f15cbc4cf3be5f4e7379271027aa0cddd57a8b4
--- /dev/null
+++ b/chrome/browser/chromeos/web_socket_proxy.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_
+#define CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+
+struct sockaddr;
+
+namespace chromeos {
+
+class WebSocketProxy {
+ public:
+ static const size_t kReadBufferLimit = 6 * 1024 * 1024;
+
+ // Limits incoming websocket headers in initial stage of connection.
+ static const size_t kHeaderLimit = 32 * 1024;
+
+ // Limits number of simultaneously open connections.
+ static const size_t kConnPoolLimit = 1000;
+
+ WebSocketProxy(
+ const std::vector<std::string>& allowed_origins,
+ struct sockaddr* addr, int addr_len);
+ ~WebSocketProxy();
+
+ // Do not call it twice.
+ void Run();
+
+ // Terminates running server (should be called on a different thread).
+ void Shutdown();
+
+ private:
+ void* impl_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebSocketProxy);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_WEB_SOCKET_PROXY_H_
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/chromeos/web_socket_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698