| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WEBRTC_TRANSPORT_H_ | 5 #ifndef REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ |
| 6 #define REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ | 6 #define REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // 1. When the first data channel is created, if it wasn't created by this | 38 // 1. When the first data channel is created, if it wasn't created by this |
| 39 // event handler. | 39 // event handler. |
| 40 // 2. Whenever a media stream is added or removed. | 40 // 2. Whenever a media stream is added or removed. |
| 41 virtual void OnWebrtcTransportConnecting() = 0; | 41 virtual void OnWebrtcTransportConnecting() = 0; |
| 42 | 42 |
| 43 // Called when the transport is connected. | 43 // Called when the transport is connected. |
| 44 virtual void OnWebrtcTransportConnected() = 0; | 44 virtual void OnWebrtcTransportConnected() = 0; |
| 45 | 45 |
| 46 // Called when there is an error connecting the session. | 46 // Called when there is an error connecting the session. |
| 47 virtual void OnWebrtcTransportError(ErrorCode error) = 0; | 47 virtual void OnWebrtcTransportError(ErrorCode error) = 0; |
| 48 |
| 49 // Called when an incoming media stream is added or removed. |
| 50 virtual void OnWebrtcTransportMediaStreamAdded( |
| 51 scoped_refptr<webrtc::MediaStreamInterface> stream) = 0; |
| 52 virtual void OnWebrtcTransportMediaStreamRemoved( |
| 53 scoped_refptr<webrtc::MediaStreamInterface> stream) = 0; |
| 48 }; | 54 }; |
| 49 | 55 |
| 50 WebrtcTransport(rtc::Thread* worker_thread, | 56 WebrtcTransport(rtc::Thread* worker_thread, |
| 51 scoped_refptr<TransportContext> transport_context, | 57 scoped_refptr<TransportContext> transport_context, |
| 52 EventHandler* event_handler); | 58 EventHandler* event_handler); |
| 53 ~WebrtcTransport() override; | 59 ~WebrtcTransport() override; |
| 54 | 60 |
| 55 webrtc::PeerConnectionInterface* peer_connection() { | 61 webrtc::PeerConnectionInterface* peer_connection() { |
| 56 return peer_connection_; | 62 return peer_connection_; |
| 57 } | 63 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 124 |
| 119 bool negotiation_pending_ = false; | 125 bool negotiation_pending_ = false; |
| 120 | 126 |
| 121 bool connected_ = false; | 127 bool connected_ = false; |
| 122 | 128 |
| 123 scoped_ptr<buzz::XmlElement> pending_transport_info_message_; | 129 scoped_ptr<buzz::XmlElement> pending_transport_info_message_; |
| 124 base::OneShotTimer transport_info_timer_; | 130 base::OneShotTimer transport_info_timer_; |
| 125 | 131 |
| 126 ScopedVector<webrtc::IceCandidateInterface> pending_incoming_candidates_; | 132 ScopedVector<webrtc::IceCandidateInterface> pending_incoming_candidates_; |
| 127 | 133 |
| 128 std::list<rtc::scoped_refptr<webrtc::MediaStreamInterface>> | |
| 129 unclaimed_streams_; | |
| 130 | |
| 131 WebrtcDataStreamAdapter outgoing_data_stream_adapter_; | 134 WebrtcDataStreamAdapter outgoing_data_stream_adapter_; |
| 132 WebrtcDataStreamAdapter incoming_data_stream_adapter_; | 135 WebrtcDataStreamAdapter incoming_data_stream_adapter_; |
| 133 | 136 |
| 134 base::WeakPtrFactory<WebrtcTransport> weak_factory_; | 137 base::WeakPtrFactory<WebrtcTransport> weak_factory_; |
| 135 | 138 |
| 136 DISALLOW_COPY_AND_ASSIGN(WebrtcTransport); | 139 DISALLOW_COPY_AND_ASSIGN(WebrtcTransport); |
| 137 }; | 140 }; |
| 138 | 141 |
| 139 } // namespace protocol | 142 } // namespace protocol |
| 140 } // namespace remoting | 143 } // namespace remoting |
| 141 | 144 |
| 142 #endif // REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ | 145 #endif // REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ |
| OLD | NEW |