| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // Start receiving packets. Packets are submitted to |packet_receiver|. | 46 // Start receiving packets. Packets are submitted to |packet_receiver|. |
| 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 | 57 |
| 58 private: | 58 private: |
| 59 // Requests and processes packets from |udp_socket_|. This method is called | 59 // 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 | 60 // 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 | 61 // packets. Thereafter, it is called with some other value as the callback |
| 62 // response from UdpSocket::RecvFrom(). | 62 // response from UdpSocket::RecvFrom(). |
| 63 void ReceiveNextPacket(int length_or_status); | 63 void ReceiveNextPacket(int length_or_status); |
| 64 | 64 |
| 65 // Schedule packet receiving, if needed. | 65 // Schedule packet receiving, if needed. |
| 66 void ScheduleReceiveNextPacket(); | 66 void ScheduleReceiveNextPacket(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 88 // NOTE: Weak pointers must be invalidated before all other member variables. | 88 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 89 base::WeakPtrFactory<UdpTransport> weak_factory_; | 89 base::WeakPtrFactory<UdpTransport> weak_factory_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(UdpTransport); | 91 DISALLOW_COPY_AND_ASSIGN(UdpTransport); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace cast | 94 } // namespace cast |
| 95 } // namespace media | 95 } // namespace media |
| 96 | 96 |
| 97 #endif // MEDIA_CAST_NET_UDP_TRANSPORT_H_ | 97 #endif // MEDIA_CAST_NET_UDP_TRANSPORT_H_ |
| OLD | NEW |