OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_PROTOCOL_TRANSPORT_H_ | 5 #ifndef REMOTING_PROTOCOL_TRANSPORT_H_ |
6 #define REMOTING_PROTOCOL_TRANSPORT_H_ | 6 #define REMOTING_PROTOCOL_TRANSPORT_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
14 #include "net/base/ip_endpoint.h" | 14 #include "net/base/ip_endpoint.h" |
15 #include "remoting/protocol/errors.h" | 15 #include "remoting/protocol/errors.h" |
16 | 16 |
17 namespace buzz { | 17 namespace buzz { |
18 class XmlElement; | 18 class XmlElement; |
19 } // namespace buzz | 19 } // namespace buzz |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 class PeerConnectionInterface; | 22 class PeerConnectionInterface; |
(...skipping 28 matching lines...) Expand all Loading... |
51 RouteType type; | 51 RouteType type; |
52 net::IPEndPoint remote_address; | 52 net::IPEndPoint remote_address; |
53 net::IPEndPoint local_address; | 53 net::IPEndPoint local_address; |
54 }; | 54 }; |
55 | 55 |
56 // Transport represents a P2P connection that consists of one or more channels. | 56 // Transport represents a P2P connection that consists of one or more channels. |
57 // This interface is used just to send and receive transport-info messages. | 57 // This interface is used just to send and receive transport-info messages. |
58 // Implementations should provide other methods to send and receive data. | 58 // Implementations should provide other methods to send and receive data. |
59 class Transport { | 59 class Transport { |
60 public: | 60 public: |
61 typedef base::Callback<void(scoped_ptr<buzz::XmlElement> transport_info)> | 61 typedef base::Callback<void(std::unique_ptr<buzz::XmlElement> transport_info)> |
62 SendTransportInfoCallback; | 62 SendTransportInfoCallback; |
63 | 63 |
64 virtual ~Transport() {} | 64 virtual ~Transport() {} |
65 | 65 |
66 // Sets the object responsible for delivering outgoing transport-info messages | 66 // Sets the object responsible for delivering outgoing transport-info messages |
67 // to the peer. | 67 // to the peer. |
68 virtual void Start( | 68 virtual void Start( |
69 Authenticator* authenticator, | 69 Authenticator* authenticator, |
70 SendTransportInfoCallback send_transport_info_callback) = 0; | 70 SendTransportInfoCallback send_transport_info_callback) = 0; |
71 virtual bool ProcessTransportInfo(buzz::XmlElement* transport_info) = 0; | 71 virtual bool ProcessTransportInfo(buzz::XmlElement* transport_info) = 0; |
72 }; | 72 }; |
73 | 73 |
74 } // namespace protocol | 74 } // namespace protocol |
75 } // namespace remoting | 75 } // namespace remoting |
76 | 76 |
77 #endif // REMOTING_PROTOCOL_TRANSPORT_H_ | 77 #endif // REMOTING_PROTOCOL_TRANSPORT_H_ |
OLD | NEW |