OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class PepperTCPServerSocket { | 23 class PepperTCPServerSocket { |
24 public: | 24 public: |
25 PepperTCPServerSocket(PepperMessageFilter* manager, | 25 PepperTCPServerSocket(PepperMessageFilter* manager, |
26 int32 routing_id, | 26 int32 routing_id, |
27 uint32 plugin_dispatcher_id, | 27 uint32 plugin_dispatcher_id, |
28 uint32 real_socket_id, | 28 uint32 real_socket_id, |
29 uint32 temp_socket_id); | 29 uint32 temp_socket_id); |
30 ~PepperTCPServerSocket(); | 30 ~PepperTCPServerSocket(); |
31 | 31 |
32 void Listen(const PP_NetAddress_Private& addr, int32 backlog); | 32 void Listen(const PP_NetAddress_Private& addr, int32 backlog); |
33 void Accept(); | 33 void Accept(int32 tcp_client_sockets_routing_id); |
34 | 34 |
35 private: | 35 private: |
36 enum State { | 36 enum State { |
37 BEFORE_LISTENING, | 37 BEFORE_LISTENING, |
38 LISTEN_IN_PROGRESS, | 38 LISTEN_IN_PROGRESS, |
39 LISTENING, | 39 LISTENING, |
40 ACCEPT_IN_PROGRESS, | 40 ACCEPT_IN_PROGRESS, |
41 }; | 41 }; |
42 | 42 |
43 void CancelListenRequest(); | 43 void CancelListenRequest(); |
44 void SendAcceptACKError(); | 44 void SendAcceptACKError(); |
45 | 45 |
46 void OnListenCompleted(int result); | 46 void OnListenCompleted(int result); |
47 void OnAcceptCompleted(int result); | 47 void OnAcceptCompleted(int32 tcp_client_sockets_routing_id, |
| 48 int result); |
48 | 49 |
49 PepperMessageFilter* manager_; | 50 PepperMessageFilter* manager_; |
50 int32 routing_id_; | 51 int32 routing_id_; |
51 uint32 plugin_dispatcher_id_; | 52 uint32 plugin_dispatcher_id_; |
52 uint32 real_socket_id_; | 53 uint32 real_socket_id_; |
53 uint32 temp_socket_id_; | 54 uint32 temp_socket_id_; |
54 | 55 |
55 State state_; | 56 State state_; |
56 | 57 |
57 scoped_ptr<net::ServerSocket> socket_; | 58 scoped_ptr<net::ServerSocket> socket_; |
58 scoped_ptr<net::StreamSocket> socket_buffer_; | 59 scoped_ptr<net::StreamSocket> socket_buffer_; |
59 | 60 |
60 DISALLOW_COPY_AND_ASSIGN(PepperTCPServerSocket); | 61 DISALLOW_COPY_AND_ASSIGN(PepperTCPServerSocket); |
61 }; | 62 }; |
62 | 63 |
63 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_ | 64 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_ |
OLD | NEW |