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 CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ |
6 #define CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "net/base/host_port_pair.h" | 10 #include "net/base/host_port_pair.h" |
11 | 11 |
12 class CastSession; | 12 class CastSession; |
13 | 13 |
14 // This class represents an end point to which communication is done by | 14 // This class represents an end point to which communication is done by |
15 // UDP. The interface does not allow direct access to a UDP socket but | 15 // UDP. The interface does not allow direct access to a UDP socket but |
16 // represents a transport mechanism. | 16 // represents a transport mechanism. |
17 // | 17 // |
18 // CastUdpTransport creates a CastSession and then shares it with | 18 // CastUdpTransport creates a CastSession and then shares it with |
19 // multiple CastSendTransports. This is because CastSession corresponds | 19 // multiple CastSendTransports. This is because CastSession corresponds |
20 // to only one remote peer. | 20 // to only one remote peer. |
21 class CastUdpTransport { | 21 class CastUdpTransport { |
22 public: | 22 public: |
23 CastUdpTransport(); | 23 CastUdpTransport(); |
24 ~CastUdpTransport(); | 24 ~CastUdpTransport(); |
25 | 25 |
26 // Begin the transport by specifying the remote IP address. | 26 // Begin the transport by specifying the remote IP address. |
27 // The transport will use UDP. | 27 // The transport will use UDP. |
28 void Start(const net::HostPortPair& remote_address); | 28 void Start(const net::IPEndPoint& remote_address); |
29 | 29 |
30 scoped_refptr<CastSession> cast_session() const { | 30 scoped_refptr<CastSession> cast_session() const { |
31 return cast_session_; | 31 return cast_session_; |
32 } | 32 } |
33 | 33 |
34 private: | 34 private: |
35 const scoped_refptr<CastSession> cast_session_; | 35 const scoped_refptr<CastSession> cast_session_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(CastUdpTransport); | 37 DISALLOW_COPY_AND_ASSIGN(CastUdpTransport); |
38 }; | 38 }; |
39 | 39 |
40 #endif // CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ | 40 #endif // CHROME_RENDERER_MEDIA_CAST_UDP_TRANSPORT_H_ |
OLD | NEW |