| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 13 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 14 #include "content/common/p2p_socket_type.h" | 16 #include "content/common/p2p_socket_type.h" |
| 15 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
| 16 #include "net/base/ip_endpoint.h" | 18 #include "net/base/ip_endpoint.h" |
| 17 #include "net/udp/datagram_socket.h" | 19 #include "net/udp/datagram_socket.h" |
| 18 | 20 |
| 19 namespace IPC { | 21 namespace IPC { |
| 20 class Sender; | 22 class Sender; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 uint16_t min_port, | 59 uint16_t min_port, |
| 58 uint16_t max_port, | 60 uint16_t max_port, |
| 59 const P2PHostAndIPEndPoint& remote_address) = 0; | 61 const P2PHostAndIPEndPoint& remote_address) = 0; |
| 60 | 62 |
| 61 // Sends |data| on the socket to |to|. | 63 // Sends |data| on the socket to |to|. |
| 62 virtual void Send(const net::IPEndPoint& to, | 64 virtual void Send(const net::IPEndPoint& to, |
| 63 const std::vector<char>& data, | 65 const std::vector<char>& data, |
| 64 const rtc::PacketOptions& options, | 66 const rtc::PacketOptions& options, |
| 65 uint64_t packet_id) = 0; | 67 uint64_t packet_id) = 0; |
| 66 | 68 |
| 67 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 69 virtual std::unique_ptr<P2PSocketHost> AcceptIncomingTcpConnection( |
| 68 const net::IPEndPoint& remote_address, int id) = 0; | 70 const net::IPEndPoint& remote_address, |
| 71 int id) = 0; |
| 69 | 72 |
| 70 virtual bool SetOption(P2PSocketOption option, int value) = 0; | 73 virtual bool SetOption(P2PSocketOption option, int value) = 0; |
| 71 | 74 |
| 72 void StartRtpDump( | 75 void StartRtpDump( |
| 73 bool incoming, | 76 bool incoming, |
| 74 bool outgoing, | 77 bool outgoing, |
| 75 const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback); | 78 const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback); |
| 76 void StopRtpDump(bool incoming, bool outgoing); | 79 void StopRtpDump(bool incoming, bool outgoing); |
| 77 | 80 |
| 78 protected: | 81 protected: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 int32_t send_bytes_delayed_cur_; | 166 int32_t send_bytes_delayed_cur_; |
| 164 | 167 |
| 165 base::WeakPtrFactory<P2PSocketHost> weak_ptr_factory_; | 168 base::WeakPtrFactory<P2PSocketHost> weak_ptr_factory_; |
| 166 | 169 |
| 167 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 170 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
| 168 }; | 171 }; |
| 169 | 172 |
| 170 } // namespace content | 173 } // namespace content |
| 171 | 174 |
| 172 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 175 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
| OLD | NEW |