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 <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
14 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
15 #include "crypto/hmac.h" | 16 #include "crypto/hmac.h" |
16 #include "remoting/protocol/transport.h" | 17 #include "remoting/protocol/transport.h" |
17 #include "remoting/protocol/webrtc_data_stream_adapter.h" | 18 #include "remoting/protocol/webrtc_data_stream_adapter.h" |
18 #include "remoting/signaling/signal_strategy.h" | 19 #include "remoting/signaling/signal_strategy.h" |
19 #include "third_party/webrtc/api/peerconnectioninterface.h" | 20 #include "third_party/webrtc/api/peerconnectioninterface.h" |
20 | 21 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return &incoming_data_stream_adapter_; | 76 return &incoming_data_stream_adapter_; |
76 } | 77 } |
77 | 78 |
78 // Transport interface. | 79 // Transport interface. |
79 void Start(Authenticator* authenticator, | 80 void Start(Authenticator* authenticator, |
80 SendTransportInfoCallback send_transport_info_callback) override; | 81 SendTransportInfoCallback send_transport_info_callback) override; |
81 bool ProcessTransportInfo(buzz::XmlElement* transport_info) override; | 82 bool ProcessTransportInfo(buzz::XmlElement* transport_info) override; |
82 | 83 |
83 private: | 84 private: |
84 void OnLocalSessionDescriptionCreated( | 85 void OnLocalSessionDescriptionCreated( |
85 scoped_ptr<webrtc::SessionDescriptionInterface> description, | 86 std::unique_ptr<webrtc::SessionDescriptionInterface> description, |
86 const std::string& error); | 87 const std::string& error); |
87 void OnLocalDescriptionSet(bool success, const std::string& error); | 88 void OnLocalDescriptionSet(bool success, const std::string& error); |
88 void OnRemoteDescriptionSet(bool send_answer, | 89 void OnRemoteDescriptionSet(bool send_answer, |
89 bool success, | 90 bool success, |
90 const std::string& error); | 91 const std::string& error); |
91 | 92 |
92 // webrtc::PeerConnectionObserver interface. | 93 // webrtc::PeerConnectionObserver interface. |
93 void OnSignalingChange( | 94 void OnSignalingChange( |
94 webrtc::PeerConnectionInterface::SignalingState new_state) override; | 95 webrtc::PeerConnectionInterface::SignalingState new_state) override; |
95 void OnAddStream(webrtc::MediaStreamInterface* stream) override; | 96 void OnAddStream(webrtc::MediaStreamInterface* stream) override; |
(...skipping 16 matching lines...) Expand all Loading... |
112 | 113 |
113 base::ThreadChecker thread_checker_; | 114 base::ThreadChecker thread_checker_; |
114 | 115 |
115 rtc::Thread* worker_thread_; | 116 rtc::Thread* worker_thread_; |
116 scoped_refptr<TransportContext> transport_context_; | 117 scoped_refptr<TransportContext> transport_context_; |
117 EventHandler* event_handler_ = nullptr; | 118 EventHandler* event_handler_ = nullptr; |
118 SendTransportInfoCallback send_transport_info_callback_; | 119 SendTransportInfoCallback send_transport_info_callback_; |
119 | 120 |
120 crypto::HMAC handshake_hmac_; | 121 crypto::HMAC handshake_hmac_; |
121 | 122 |
122 scoped_ptr<webrtc::FakeAudioDeviceModule> fake_audio_device_module_; | 123 std::unique_ptr<webrtc::FakeAudioDeviceModule> fake_audio_device_module_; |
123 | 124 |
124 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> | 125 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> |
125 peer_connection_factory_; | 126 peer_connection_factory_; |
126 rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; | 127 rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; |
127 | 128 |
128 bool negotiation_pending_ = false; | 129 bool negotiation_pending_ = false; |
129 | 130 |
130 bool connected_ = false; | 131 bool connected_ = false; |
131 | 132 |
132 scoped_ptr<buzz::XmlElement> pending_transport_info_message_; | 133 std::unique_ptr<buzz::XmlElement> pending_transport_info_message_; |
133 base::OneShotTimer transport_info_timer_; | 134 base::OneShotTimer transport_info_timer_; |
134 | 135 |
135 ScopedVector<webrtc::IceCandidateInterface> pending_incoming_candidates_; | 136 ScopedVector<webrtc::IceCandidateInterface> pending_incoming_candidates_; |
136 | 137 |
137 WebrtcDataStreamAdapter outgoing_data_stream_adapter_; | 138 WebrtcDataStreamAdapter outgoing_data_stream_adapter_; |
138 WebrtcDataStreamAdapter incoming_data_stream_adapter_; | 139 WebrtcDataStreamAdapter incoming_data_stream_adapter_; |
139 | 140 |
140 base::WeakPtrFactory<WebrtcTransport> weak_factory_; | 141 base::WeakPtrFactory<WebrtcTransport> weak_factory_; |
141 | 142 |
142 DISALLOW_COPY_AND_ASSIGN(WebrtcTransport); | 143 DISALLOW_COPY_AND_ASSIGN(WebrtcTransport); |
143 }; | 144 }; |
144 | 145 |
145 } // namespace protocol | 146 } // namespace protocol |
146 } // namespace remoting | 147 } // namespace remoting |
147 | 148 |
148 #endif // REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ | 149 #endif // REMOTING_PROTOCOL_WEBRTC_TRANSPORT_H_ |
OLD | NEW |