| 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 CONTENT_RENDERER_P2P_SOCKET_CLIENT_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_P2P_SOCKET_CLIENT_IMPL_H_ |
| 6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_IMPL_H_ | 6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 STATE_OPEN, | 67 STATE_OPEN, |
| 68 STATE_CLOSED, | 68 STATE_CLOSED, |
| 69 STATE_ERROR, | 69 STATE_ERROR, |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 friend class P2PSocketDispatcher; | 72 friend class P2PSocketDispatcher; |
| 73 | 73 |
| 74 virtual ~P2PSocketClientImpl(); | 74 virtual ~P2PSocketClientImpl(); |
| 75 | 75 |
| 76 // Message handlers that run on IPC thread. | 76 // Message handlers that run on IPC thread. |
| 77 void OnSocketCreated(const net::IPEndPoint& address); | 77 void OnSocketCreated(const net::IPEndPoint& address, |
| 78 const net::IPEndPoint& remote_address); |
| 78 void OnIncomingTcpConnection(const net::IPEndPoint& address); | 79 void OnIncomingTcpConnection(const net::IPEndPoint& address); |
| 79 void OnSendComplete(int packet_id); | 80 void OnSendComplete(int packet_id); |
| 80 void OnSendComplete(); | 81 void OnSendComplete(); |
| 81 void OnError(); | 82 void OnError(); |
| 82 void OnDataReceived(const net::IPEndPoint& address, | 83 void OnDataReceived(const net::IPEndPoint& address, |
| 83 const std::vector<char>& data, | 84 const std::vector<char>& data, |
| 84 const base::TimeTicks& timestamp); | 85 const base::TimeTicks& timestamp); |
| 85 | 86 |
| 86 // Proxy methods that deliver messages to the delegate thread. | 87 // Proxy methods that deliver messages to the delegate thread. |
| 87 void DeliverOnSocketCreated(const net::IPEndPoint& address); | 88 void DeliverOnSocketCreated(const net::IPEndPoint& address, |
| 89 const net::IPEndPoint& remote_address); |
| 88 void DeliverOnIncomingTcpConnection( | 90 void DeliverOnIncomingTcpConnection( |
| 89 const net::IPEndPoint& address, | 91 const net::IPEndPoint& address, |
| 90 scoped_refptr<P2PSocketClient> new_client); | 92 scoped_refptr<P2PSocketClient> new_client); |
| 91 void DeliverOnSendComplete(); | 93 void DeliverOnSendComplete(); |
| 92 void DeliverOnError(); | 94 void DeliverOnError(); |
| 93 void DeliverOnDataReceived(const net::IPEndPoint& address, | 95 void DeliverOnDataReceived(const net::IPEndPoint& address, |
| 94 const std::vector<char>& data, | 96 const std::vector<char>& data, |
| 95 const base::TimeTicks& timestamp); | 97 const base::TimeTicks& timestamp); |
| 96 | 98 |
| 97 // Scheduled on the IPC thread to finish initialization. | 99 // Scheduled on the IPC thread to finish initialization. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 // These two fields are used to identify packets for tracing. | 117 // These two fields are used to identify packets for tracing. |
| 116 uint32 random_socket_id_; | 118 uint32 random_socket_id_; |
| 117 uint32 next_packet_id_; | 119 uint32 next_packet_id_; |
| 118 | 120 |
| 119 DISALLOW_COPY_AND_ASSIGN(P2PSocketClientImpl); | 121 DISALLOW_COPY_AND_ASSIGN(P2PSocketClientImpl); |
| 120 }; | 122 }; |
| 121 | 123 |
| 122 } // namespace content | 124 } // namespace content |
| 123 | 125 |
| 124 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_IMPL_H_ | 126 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_IMPL_H_ |
| OLD | NEW |