Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: webrtc/api/webrtcsession.cc

Issue 2606123002: Remove the dependency of TransportChannel and TransportChannelImpl. (Closed)
Patch Set: Revert the change of stun_unittests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 17 matching lines...) Expand all
28 #include "webrtc/base/checks.h" 28 #include "webrtc/base/checks.h"
29 #include "webrtc/base/helpers.h" 29 #include "webrtc/base/helpers.h"
30 #include "webrtc/base/logging.h" 30 #include "webrtc/base/logging.h"
31 #include "webrtc/base/stringencode.h" 31 #include "webrtc/base/stringencode.h"
32 #include "webrtc/base/stringutils.h" 32 #include "webrtc/base/stringutils.h"
33 #include "webrtc/call/call.h" 33 #include "webrtc/call/call.h"
34 #include "webrtc/media/base/mediaconstants.h" 34 #include "webrtc/media/base/mediaconstants.h"
35 #include "webrtc/media/base/videocapturer.h" 35 #include "webrtc/media/base/videocapturer.h"
36 #include "webrtc/media/sctp/sctptransportinternal.h" 36 #include "webrtc/media/sctp/sctptransportinternal.h"
37 #include "webrtc/p2p/base/portallocator.h" 37 #include "webrtc/p2p/base/portallocator.h"
38 #include "webrtc/p2p/base/transportchannel.h"
39 #include "webrtc/pc/channel.h" 38 #include "webrtc/pc/channel.h"
40 #include "webrtc/pc/channelmanager.h" 39 #include "webrtc/pc/channelmanager.h"
41 #include "webrtc/pc/mediasession.h" 40 #include "webrtc/pc/mediasession.h"
42 41
43 #ifdef HAVE_QUIC 42 #ifdef HAVE_QUIC
44 #include "webrtc/p2p/quic/quictransportchannel.h" 43 #include "webrtc/p2p/quic/quictransportchannel.h"
45 #endif // HAVE_QUIC 44 #endif // HAVE_QUIC
46 45
47 using cricket::ContentInfo; 46 using cricket::ContentInfo;
48 using cricket::ContentInfos; 47 using cricket::ContentInfos;
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1889 std::move(transport_stats); 1888 std::move(transport_stats);
1890 } 1889 }
1891 } 1890 }
1892 return session_stats; 1891 return session_stats;
1893 } 1892 }
1894 1893
1895 bool WebRtcSession::CreateSctpTransport_n(const std::string& content_name, 1894 bool WebRtcSession::CreateSctpTransport_n(const std::string& content_name,
1896 const std::string& transport_name) { 1895 const std::string& transport_name) {
1897 RTC_DCHECK(network_thread_->IsCurrent()); 1896 RTC_DCHECK(network_thread_->IsCurrent());
1898 RTC_DCHECK(sctp_factory_); 1897 RTC_DCHECK(sctp_factory_);
1899 cricket::TransportChannel* tc = 1898 cricket::DtlsTransportInternal* tc =
1900 transport_controller_->CreateTransportChannel_n( 1899 transport_controller_->CreateTransportChannel_n(
1901 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP); 1900 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
1902 sctp_transport_ = sctp_factory_->CreateSctpTransport(tc); 1901 sctp_transport_ = sctp_factory_->CreateSctpTransport(tc);
1903 RTC_DCHECK(sctp_transport_); 1902 RTC_DCHECK(sctp_transport_);
1904 sctp_invoker_.reset(new rtc::AsyncInvoker()); 1903 sctp_invoker_.reset(new rtc::AsyncInvoker());
1905 sctp_transport_->SignalReadyToSendData.connect( 1904 sctp_transport_->SignalReadyToSendData.connect(
1906 this, &WebRtcSession::OnSctpTransportReadyToSendData_n); 1905 this, &WebRtcSession::OnSctpTransportReadyToSendData_n);
1907 sctp_transport_->SignalDataReceived.connect( 1906 sctp_transport_->SignalDataReceived.connect(
1908 this, &WebRtcSession::OnSctpTransportDataReceived_n); 1907 this, &WebRtcSession::OnSctpTransportDataReceived_n);
1909 sctp_transport_->SignalStreamClosedRemotely.connect( 1908 sctp_transport_->SignalStreamClosedRemotely.connect(
1910 this, &WebRtcSession::OnSctpStreamClosedRemotely_n); 1909 this, &WebRtcSession::OnSctpStreamClosedRemotely_n);
1911 sctp_transport_name_ = rtc::Optional<std::string>(transport_name); 1910 sctp_transport_name_ = rtc::Optional<std::string>(transport_name);
1912 sctp_content_name_ = rtc::Optional<std::string>(content_name); 1911 sctp_content_name_ = rtc::Optional<std::string>(content_name);
1913 return true; 1912 return true;
1914 } 1913 }
1915 1914
1916 void WebRtcSession::ChangeSctpTransport_n(const std::string& transport_name) { 1915 void WebRtcSession::ChangeSctpTransport_n(const std::string& transport_name) {
1917 RTC_DCHECK(network_thread_->IsCurrent()); 1916 RTC_DCHECK(network_thread_->IsCurrent());
1918 RTC_DCHECK(sctp_transport_); 1917 RTC_DCHECK(sctp_transport_);
1919 RTC_DCHECK(sctp_transport_name_); 1918 RTC_DCHECK(sctp_transport_name_);
1920 std::string old_sctp_transport_name = *sctp_transport_name_; 1919 std::string old_sctp_transport_name = *sctp_transport_name_;
1921 sctp_transport_name_ = rtc::Optional<std::string>(transport_name); 1920 sctp_transport_name_ = rtc::Optional<std::string>(transport_name);
1922 cricket::TransportChannel* tc = 1921 cricket::DtlsTransportInternal* tc =
1923 transport_controller_->CreateTransportChannel_n( 1922 transport_controller_->CreateTransportChannel_n(
1924 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP); 1923 transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
pthatcher1 2017/01/13 22:41:16 If it returns a DtlsTransport, then we should rena
Zhi Huang 2017/01/16 10:38:24 Sure. There will be no concept of "channel" in P2P
1925 sctp_transport_->SetTransportChannel(tc); 1924 sctp_transport_->SetTransportChannel(tc);
1926 transport_controller_->DestroyTransportChannel_n( 1925 transport_controller_->DestroyTransportChannel_n(
1927 old_sctp_transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP); 1926 old_sctp_transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
1928 } 1927 }
1929 1928
1930 void WebRtcSession::DestroySctpTransport_n() { 1929 void WebRtcSession::DestroySctpTransport_n() {
1931 RTC_DCHECK(network_thread_->IsCurrent()); 1930 RTC_DCHECK(network_thread_->IsCurrent());
1932 sctp_transport_.reset(nullptr); 1931 sctp_transport_.reset(nullptr);
1933 sctp_content_name_.reset(); 1932 sctp_content_name_.reset();
1934 sctp_transport_name_.reset(); 1933 sctp_transport_name_.reset();
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 return *sctp_transport_name_; 2311 return *sctp_transport_name_;
2313 } 2312 }
2314 } 2313 }
2315 // Return an empty string if failed to retrieve the transport name. 2314 // Return an empty string if failed to retrieve the transport name.
2316 return ""; 2315 return "";
2317 } 2316 }
2318 return channel->transport_name(); 2317 return channel->transport_name();
2319 } 2318 }
2320 2319
2321 } // namespace webrtc 2320 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/webrtcsession_unittest.cc » ('j') | webrtc/p2p/base/dtlstransportchannel.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698