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 MEDIA_CAST_NET_UDP_TRANSPORT_H_ | 5 #ifndef MEDIA_CAST_NET_UDP_TRANSPORT_H_ |
6 #define MEDIA_CAST_NET_UDP_TRANSPORT_H_ | 6 #define MEDIA_CAST_NET_UDP_TRANSPORT_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 void StartReceiving(const PacketReceiverCallback& packet_receiver); | 47 void StartReceiving(const PacketReceiverCallback& packet_receiver); |
48 | 48 |
49 // Set a new DSCP value to the socket. The value will be set right before | 49 // Set a new DSCP value to the socket. The value will be set right before |
50 // the next send. | 50 // the next send. |
51 void SetDscp(net::DiffServCodePoint dscp); | 51 void SetDscp(net::DiffServCodePoint dscp); |
52 | 52 |
53 // PacketSender implementations. | 53 // PacketSender implementations. |
54 virtual bool SendPacket(PacketRef packet, | 54 virtual bool SendPacket(PacketRef packet, |
55 const base::Closure& cb) override; | 55 const base::Closure& cb) override; |
56 virtual int64 GetBytesSent() override; | 56 virtual int64 GetBytesSent() override; |
| 57 virtual int SetSendBufferSize(int32 size) override; |
57 | 58 |
58 private: | 59 private: |
59 // Requests and processes packets from |udp_socket_|. This method is called | 60 // Requests and processes packets from |udp_socket_|. This method is called |
60 // once with |length_or_status| set to net::ERR_IO_PENDING to start receiving | 61 // once with |length_or_status| set to net::ERR_IO_PENDING to start receiving |
61 // packets. Thereafter, it is called with some other value as the callback | 62 // packets. Thereafter, it is called with some other value as the callback |
62 // response from UdpSocket::RecvFrom(). | 63 // response from UdpSocket::RecvFrom(). |
63 void ReceiveNextPacket(int length_or_status); | 64 void ReceiveNextPacket(int length_or_status); |
64 | 65 |
65 // Schedule packet receiving, if needed. | 66 // Schedule packet receiving, if needed. |
66 void ScheduleReceiveNextPacket(); | 67 void ScheduleReceiveNextPacket(); |
(...skipping 21 matching lines...) Expand all Loading... |
88 // NOTE: Weak pointers must be invalidated before all other member variables. | 89 // NOTE: Weak pointers must be invalidated before all other member variables. |
89 base::WeakPtrFactory<UdpTransport> weak_factory_; | 90 base::WeakPtrFactory<UdpTransport> weak_factory_; |
90 | 91 |
91 DISALLOW_COPY_AND_ASSIGN(UdpTransport); | 92 DISALLOW_COPY_AND_ASSIGN(UdpTransport); |
92 }; | 93 }; |
93 | 94 |
94 } // namespace cast | 95 } // namespace cast |
95 } // namespace media | 96 } // namespace media |
96 | 97 |
97 #endif // MEDIA_CAST_NET_UDP_TRANSPORT_H_ | 98 #endif // MEDIA_CAST_NET_UDP_TRANSPORT_H_ |
OLD | NEW |