OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 PPAPI_SHARED_IMPL_PPB_TCP_SOCKET_SHARED_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPB_TCP_SOCKET_SHARED_H_ |
6 #define PPAPI_SHARED_IMPL_PPB_TCP_SOCKET_SHARED_H_ | 6 #define PPAPI_SHARED_IMPL_PPB_TCP_SOCKET_SHARED_H_ |
7 | 7 |
8 #include "ppapi/shared_impl/ppapi_shared_export.h" | 8 #include "ppapi/shared_impl/ppapi_shared_export.h" |
9 | 9 |
10 namespace ppapi { | 10 namespace ppapi { |
(...skipping 11 matching lines...) Expand all Loading... |
22 SSL_CONNECTED, | 22 SSL_CONNECTED, |
23 // The socket is listening. | 23 // The socket is listening. |
24 LISTENING, | 24 LISTENING, |
25 // The socket has been closed. | 25 // The socket has been closed. |
26 CLOSED | 26 CLOSED |
27 }; | 27 }; |
28 | 28 |
29 // Transitions that will change the socket state. Please note that | 29 // Transitions that will change the socket state. Please note that |
30 // read/write/accept are not included because they don't change the socket | 30 // read/write/accept are not included because they don't change the socket |
31 // state. | 31 // state. |
32 enum TransitionType { | 32 enum TransitionType { NONE, BIND, CONNECT, SSL_CONNECT, LISTEN, CLOSE }; |
33 NONE, | |
34 BIND, | |
35 CONNECT, | |
36 SSL_CONNECT, | |
37 LISTEN, | |
38 CLOSE | |
39 }; | |
40 | 33 |
41 explicit TCPSocketState(StateType state); | 34 explicit TCPSocketState(StateType state); |
42 ~TCPSocketState(); | 35 ~TCPSocketState(); |
43 | 36 |
44 StateType state() const { return state_; } | 37 StateType state() const { return state_; } |
45 | 38 |
46 void SetPendingTransition(TransitionType pending_transition); | 39 void SetPendingTransition(TransitionType pending_transition); |
47 void CompletePendingTransition(bool success); | 40 void CompletePendingTransition(bool success); |
48 | 41 |
49 void DoTransition(TransitionType transition, bool success); | 42 void DoTransition(TransitionType transition, bool success); |
(...skipping 15 matching lines...) Expand all Loading... |
65 TCP_SOCKET_VERSION_PRIVATE, | 58 TCP_SOCKET_VERSION_PRIVATE, |
66 // PPB_TCPSocket v1.0. | 59 // PPB_TCPSocket v1.0. |
67 TCP_SOCKET_VERSION_1_0, | 60 TCP_SOCKET_VERSION_1_0, |
68 // PPB_TCPSocket v1.1 or above. | 61 // PPB_TCPSocket v1.1 or above. |
69 TCP_SOCKET_VERSION_1_1_OR_ABOVE | 62 TCP_SOCKET_VERSION_1_1_OR_ABOVE |
70 }; | 63 }; |
71 | 64 |
72 } // namespace ppapi | 65 } // namespace ppapi |
73 | 66 |
74 #endif // PPAPI_SHARED_IMPL_PPB_TCP_SOCKET_SHARED_H_ | 67 #endif // PPAPI_SHARED_IMPL_PPB_TCP_SOCKET_SHARED_H_ |
OLD | NEW |