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 #include "net/socket/web_socket_server_socket.h" | 5 #include "net/socket/web_socket_server_socket.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #if defined(OS_WIN) | |
14 #include <winsock2.h> // for htonl | |
15 #else | |
16 #include <arpa/inet.h> | |
17 #endif | |
18 | |
19 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
20 #include "base/bind.h" | 14 #include "base/bind.h" |
21 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
22 #include "base/logging.h" | 16 #include "base/logging.h" |
23 #include "base/md5.h" | 17 #include "base/md5.h" |
24 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
25 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
26 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
27 #include "base/message_loop.h" | 21 #include "base/message_loop.h" |
28 #include "base/string_util.h" | 22 #include "base/string_util.h" |
| 23 #include "base/sys_byteorder.h" |
29 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
30 #include "net/base/completion_callback.h" | 25 #include "net/base/completion_callback.h" |
31 #include "net/base/io_buffer.h" | 26 #include "net/base/io_buffer.h" |
32 #include "net/base/net_errors.h" | 27 #include "net/base/net_errors.h" |
33 | 28 |
34 namespace { | 29 namespace { |
35 | 30 |
36 const size_t kHandshakeLimitBytes = 1 << 14; | 31 const size_t kHandshakeLimitBytes = 1 << 14; |
37 | 32 |
38 const char kCrOctet = '\r'; | 33 const char kCrOctet = '\r'; |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 | 887 |
893 WebSocketServerSocket* CreateWebSocketServerSocket( | 888 WebSocketServerSocket* CreateWebSocketServerSocket( |
894 Socket* transport_socket, WebSocketServerSocket::Delegate* delegate) { | 889 Socket* transport_socket, WebSocketServerSocket::Delegate* delegate) { |
895 return new WebSocketServerSocketImpl(transport_socket, delegate); | 890 return new WebSocketServerSocketImpl(transport_socket, delegate); |
896 } | 891 } |
897 | 892 |
898 WebSocketServerSocket::~WebSocketServerSocket() { | 893 WebSocketServerSocket::~WebSocketServerSocket() { |
899 } | 894 } |
900 | 895 |
901 } // namespace net; | 896 } // namespace net; |
OLD | NEW |