| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_P2P_SOCKET_CLIENT_DELEGATE_H_ |
| 6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_DELEGATE_H_ | 6 #define CONTENT_RENDERER_P2P_SOCKET_CLIENT_DELEGATE_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 13 matching lines...) Expand all Loading... |
| 24 // you should not rely on the local endpoint address if possible. | 24 // you should not rely on the local endpoint address if possible. |
| 25 virtual void OnOpen(const net::IPEndPoint& local_address, | 25 virtual void OnOpen(const net::IPEndPoint& local_address, |
| 26 const net::IPEndPoint& remote_address) = 0; | 26 const net::IPEndPoint& remote_address) = 0; |
| 27 | 27 |
| 28 // For a socket that is listening on incoming TCP connectsion, this | 28 // For a socket that is listening on incoming TCP connectsion, this |
| 29 // function is called when a new client connects. | 29 // function is called when a new client connects. |
| 30 virtual void OnIncomingTcpConnection(const net::IPEndPoint& address, | 30 virtual void OnIncomingTcpConnection(const net::IPEndPoint& address, |
| 31 P2PSocketClient* client) = 0; | 31 P2PSocketClient* client) = 0; |
| 32 | 32 |
| 33 // Called once for each Send() call after the send is complete. | 33 // Called once for each Send() call after the send is complete. |
| 34 virtual void OnSendComplete() = 0; | 34 virtual void OnSendComplete(const P2PSendPacketMetrics& send_metrics) = 0; |
| 35 | 35 |
| 36 // Called if an non-retryable error occurs. | 36 // Called if an non-retryable error occurs. |
| 37 virtual void OnError() = 0; | 37 virtual void OnError() = 0; |
| 38 | 38 |
| 39 // Called when data is received on the socket. | 39 // Called when data is received on the socket. |
| 40 virtual void OnDataReceived(const net::IPEndPoint& address, | 40 virtual void OnDataReceived(const net::IPEndPoint& address, |
| 41 const std::vector<char>& data, | 41 const std::vector<char>& data, |
| 42 const base::TimeTicks& timestamp) = 0; | 42 const base::TimeTicks& timestamp) = 0; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace content | 45 } // namespace content |
| 46 | 46 |
| 47 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_DELEGATE_H_ | 47 #endif // CONTENT_RENDERER_P2P_SOCKET_CLIENT_DELEGATE_H_ |
| OLD | NEW |