| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool RemoveRemoteCandidates(const Candidates& candidates, std::string* err); | 106 bool RemoveRemoteCandidates(const Candidates& candidates, std::string* err); |
| 107 bool ReadyForRemoteCandidates(const std::string& transport_name) const; | 107 bool ReadyForRemoteCandidates(const std::string& transport_name) const; |
| 108 // TODO(deadbeef): GetStats isn't const because all the way down to | 108 // TODO(deadbeef): GetStats isn't const because all the way down to |
| 109 // OpenSSLStreamAdapter, | 109 // OpenSSLStreamAdapter, |
| 110 // GetSslCipherSuite and GetDtlsSrtpCryptoSuite are not const. Fix this. | 110 // GetSslCipherSuite and GetDtlsSrtpCryptoSuite are not const. Fix this. |
| 111 bool GetStats(const std::string& transport_name, TransportStats* stats); | 111 bool GetStats(const std::string& transport_name, TransportStats* stats); |
| 112 void SetMetricsObserver(webrtc::MetricsObserverInterface* metrics_observer); | 112 void SetMetricsObserver(webrtc::MetricsObserverInterface* metrics_observer); |
| 113 | 113 |
| 114 // Creates a channel if it doesn't exist. Otherwise, increments a reference | 114 // Creates a channel if it doesn't exist. Otherwise, increments a reference |
| 115 // count and returns an existing channel. | 115 // count and returns an existing channel. |
| 116 TransportChannel* CreateTransportChannel(const std::string& transport_name, | 116 DtlsTransportInternal* CreateDtlsTransport(const std::string& transport_name, |
| 117 int component); | 117 int component); |
| 118 virtual TransportChannel* CreateTransportChannel_n( | 118 virtual DtlsTransportInternal* CreateDtlsTransport_n( |
| 119 const std::string& transport_name, | 119 const std::string& transport_name, |
| 120 int component); | 120 int component); |
| 121 | 121 |
| 122 // Decrements a channel's reference count, and destroys the channel if | 122 // Decrements a channel's reference count, and destroys the channel if |
| 123 // nothing is referencing it. | 123 // nothing is referencing it. |
| 124 virtual void DestroyTransportChannel_n(const std::string& transport_name, | 124 virtual void DestroyDtlsTransport_n(const std::string& transport_name, |
| 125 int component); | 125 int component); |
| 126 | 126 |
| 127 void use_quic() { quic_ = true; } | 127 void use_quic() { quic_ = true; } |
| 128 bool quic() const { return quic_; } | 128 bool quic() const { return quic_; } |
| 129 | 129 |
| 130 // TODO(deadbeef): Remove all for_testing methods! | 130 // TODO(deadbeef): Remove all for_testing methods! |
| 131 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate_for_testing() | 131 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate_for_testing() |
| 132 const { | 132 const { |
| 133 return certificate_; | 133 return certificate_; |
| 134 } | 134 } |
| 135 std::vector<std::string> transport_names_for_testing(); | 135 std::vector<std::string> transport_names_for_testing(); |
| 136 std::vector<TransportChannelImpl*> channels_for_testing(); | 136 std::vector<DtlsTransportInternal*> channels_for_testing(); |
| 137 TransportChannelImpl* get_channel_for_testing( | 137 DtlsTransportInternal* get_channel_for_testing( |
| 138 const std::string& transport_name, | 138 const std::string& transport_name, |
| 139 int component); | 139 int component); |
| 140 | 140 |
| 141 // All of these signals are fired on the signalling thread. | 141 // All of these signals are fired on the signalling thread. |
| 142 | 142 |
| 143 // If any transport failed => failed, | 143 // If any transport failed => failed, |
| 144 // Else if all completed => completed, | 144 // Else if all completed => completed, |
| 145 // Else if all connected => connected, | 145 // Else if all connected => connected, |
| 146 // Else => connecting | 146 // Else => connecting |
| 147 sigslot::signal1<IceConnectionState> SignalConnectionState; | 147 sigslot::signal1<IceConnectionState> SignalConnectionState; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 162 | 162 |
| 163 sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError; | 163 sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError; |
| 164 | 164 |
| 165 protected: | 165 protected: |
| 166 // TODO(deadbeef): Get rid of these virtual methods. Used by | 166 // TODO(deadbeef): Get rid of these virtual methods. Used by |
| 167 // FakeTransportController currently, but FakeTransportController shouldn't | 167 // FakeTransportController currently, but FakeTransportController shouldn't |
| 168 // even be functioning by subclassing TransportController. | 168 // even be functioning by subclassing TransportController. |
| 169 virtual IceTransportInternal* CreateIceTransportChannel_n( | 169 virtual IceTransportInternal* CreateIceTransportChannel_n( |
| 170 const std::string& transport_name, | 170 const std::string& transport_name, |
| 171 int component); | 171 int component); |
| 172 virtual TransportChannelImpl* CreateDtlsTransportChannel_n( | 172 virtual DtlsTransportInternal* CreateDtlsTransportChannel_n( |
| 173 const std::string& transport_name, | 173 const std::string& transport_name, |
| 174 int component, | 174 int component, |
| 175 IceTransportInternal* ice); | 175 IceTransportInternal* ice); |
| 176 | 176 |
| 177 private: | 177 private: |
| 178 void OnMessage(rtc::Message* pmsg) override; | 178 void OnMessage(rtc::Message* pmsg) override; |
| 179 | 179 |
| 180 class ChannelPair; | 180 class ChannelPair; |
| 181 typedef rtc::RefCountedObject<ChannelPair> RefCountedChannel; | 181 typedef rtc::RefCountedObject<ChannelPair> RefCountedChannel; |
| 182 | 182 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 const Candidates& candidates, | 224 const Candidates& candidates, |
| 225 std::string* err); | 225 std::string* err); |
| 226 bool RemoveRemoteCandidates_n(const Candidates& candidates, std::string* err); | 226 bool RemoveRemoteCandidates_n(const Candidates& candidates, std::string* err); |
| 227 bool ReadyForRemoteCandidates_n(const std::string& transport_name) const; | 227 bool ReadyForRemoteCandidates_n(const std::string& transport_name) const; |
| 228 bool GetStats_n(const std::string& transport_name, TransportStats* stats); | 228 bool GetStats_n(const std::string& transport_name, TransportStats* stats); |
| 229 void SetMetricsObserver_n(webrtc::MetricsObserverInterface* metrics_observer); | 229 void SetMetricsObserver_n(webrtc::MetricsObserverInterface* metrics_observer); |
| 230 | 230 |
| 231 // Handlers for signals from Transport. | 231 // Handlers for signals from Transport. |
| 232 void OnChannelWritableState_n(rtc::PacketTransportInterface* transport); | 232 void OnChannelWritableState_n(rtc::PacketTransportInterface* transport); |
| 233 void OnChannelReceivingState_n(rtc::PacketTransportInterface* transport); | 233 void OnChannelReceivingState_n(rtc::PacketTransportInterface* transport); |
| 234 void OnChannelGatheringState_n(TransportChannelImpl* channel); | 234 void OnChannelGatheringState_n(IceTransportInternal* channel); |
| 235 void OnChannelCandidateGathered_n(TransportChannelImpl* channel, | 235 void OnChannelCandidateGathered_n(IceTransportInternal* channel, |
| 236 const Candidate& candidate); | 236 const Candidate& candidate); |
| 237 void OnChannelCandidatesRemoved(const Candidates& candidates); | 237 void OnChannelCandidatesRemoved(const Candidates& candidates); |
| 238 void OnChannelCandidatesRemoved_n(TransportChannelImpl* channel, | 238 void OnChannelCandidatesRemoved_n(IceTransportInternal* channel, |
| 239 const Candidates& candidates); | 239 const Candidates& candidates); |
| 240 void OnChannelRoleConflict_n(TransportChannelImpl* channel); | 240 void OnChannelRoleConflict_n(IceTransportInternal* channel); |
| 241 void OnChannelStateChanged_n(TransportChannelImpl* channel); | 241 void OnChannelStateChanged_n(IceTransportInternal* channel); |
| 242 | 242 |
| 243 void UpdateAggregateStates_n(); | 243 void UpdateAggregateStates_n(); |
| 244 | 244 |
| 245 void OnDtlsHandshakeError(rtc::SSLHandshakeError error); | 245 void OnDtlsHandshakeError(rtc::SSLHandshakeError error); |
| 246 | 246 |
| 247 rtc::Thread* const signaling_thread_ = nullptr; | 247 rtc::Thread* const signaling_thread_ = nullptr; |
| 248 rtc::Thread* const network_thread_ = nullptr; | 248 rtc::Thread* const network_thread_ = nullptr; |
| 249 PortAllocator* const port_allocator_ = nullptr; | 249 PortAllocator* const port_allocator_ = nullptr; |
| 250 | 250 |
| 251 std::map<std::string, std::unique_ptr<JsepTransport>> transports_; | 251 std::map<std::string, std::unique_ptr<JsepTransport>> transports_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 267 bool quic_ = false; | 267 bool quic_ = false; |
| 268 | 268 |
| 269 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; | 269 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; |
| 270 | 270 |
| 271 RTC_DISALLOW_COPY_AND_ASSIGN(TransportController); | 271 RTC_DISALLOW_COPY_AND_ASSIGN(TransportController); |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 } // namespace cricket | 274 } // namespace cricket |
| 275 | 275 |
| 276 #endif // WEBRTC_P2P_BASE_TRANSPORTCONTROLLER_H_ | 276 #endif // WEBRTC_P2P_BASE_TRANSPORTCONTROLLER_H_ |
| OLD | NEW |