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 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "content/common/p2p_sockets.h" | 9 #include "content/common/p2p_sockets.h" |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 STUN_SEND_REQUEST = 0x0004, | 58 STUN_SEND_REQUEST = 0x0004, |
59 STUN_SEND_RESPONSE = 0x0104, | 59 STUN_SEND_RESPONSE = 0x0104, |
60 STUN_SEND_ERROR_RESPONSE = 0x0114, | 60 STUN_SEND_ERROR_RESPONSE = 0x0114, |
61 STUN_DATA_INDICATION = 0x0115 | 61 STUN_DATA_INDICATION = 0x0115 |
62 }; | 62 }; |
63 | 63 |
64 enum State { | 64 enum State { |
65 STATE_UNINITIALIZED, | 65 STATE_UNINITIALIZED, |
66 STATE_CONNECTING, | 66 STATE_CONNECTING, |
67 STATE_OPEN, | 67 STATE_OPEN, |
68 STATE_TLS_CONNECTING, | |
juberti2
2013/08/08 22:16:06
I was thinking TLS_CONNECTING would come before OP
Mallinath (Gone from Chromium)
2013/08/08 22:25:59
Done.
| |
68 STATE_ERROR, | 69 STATE_ERROR, |
69 }; | 70 }; |
70 | 71 |
71 P2PSocketHost(IPC::Sender* message_sender, int id); | 72 P2PSocketHost(IPC::Sender* message_sender, int id); |
72 | 73 |
73 // Verifies that the packet |data| has a valid STUN header. In case | 74 // Verifies that the packet |data| has a valid STUN header. In case |
74 // of success stores type of the message in |type|. | 75 // of success stores type of the message in |type|. |
75 static bool GetStunPacketType(const char* data, int data_size, | 76 static bool GetStunPacketType(const char* data, int data_size, |
76 StunMessageType* type); | 77 StunMessageType* type); |
77 static bool IsRequestOrResponse(StunMessageType type); | 78 static bool IsRequestOrResponse(StunMessageType type); |
78 | 79 |
79 IPC::Sender* message_sender_; | 80 IPC::Sender* message_sender_; |
80 int id_; | 81 int id_; |
81 State state_; | 82 State state_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 84 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace content | 87 } // namespace content |
87 | 88 |
88 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 89 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
OLD | NEW |