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

Unified Diff: remoting/protocol/webrtc_data_stream_adapter.cc

Issue 1510333002: Cleanups in WebrtcTransport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/webrtc_data_stream_adapter.cc
diff --git a/remoting/protocol/webrtc_data_stream_adapter.cc b/remoting/protocol/webrtc_data_stream_adapter.cc
index 9c1dac1a357d4f15d72b724365be3f838d16c7f8..b53800fb2853f0b22c8ab9cb52cd9bcd819218f6 100644
--- a/remoting/protocol/webrtc_data_stream_adapter.cc
+++ b/remoting/protocol/webrtc_data_stream_adapter.cc
@@ -209,11 +209,11 @@ WebrtcDataStreamAdapter::~WebrtcDataStreamAdapter() {
void WebrtcDataStreamAdapter::Initialize(
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection,
- bool is_server) {
+ bool outgoing) {
peer_connection_ = peer_connection;
- is_server_ = is_server;
+ outgoing_ = outgoing;
- if (!is_server_) {
+ if (outgoing_) {
for (auto& channel : pending_channels_) {
webrtc::DataChannelInit config;
config.reliable = true;
@@ -226,7 +226,7 @@ void WebrtcDataStreamAdapter::Initialize(
void WebrtcDataStreamAdapter::OnIncomingDataChannel(
webrtc::DataChannelInterface* data_channel) {
auto it = pending_channels_.find(data_channel->label());
- if (!is_server_ || it == pending_channels_.end()) {
+ if (outgoing_ || it == pending_channels_.end()) {
LOG(ERROR) << "Received unexpected data channel " << data_channel->label();
return;
}
@@ -243,7 +243,7 @@ void WebrtcDataStreamAdapter::CreateChannel(
base::Unretained(this), callback));
pending_channels_[name] = channel;
- if (peer_connection_ && !is_server_) {
+ if (peer_connection_ && outgoing_) {
webrtc::DataChannelInit config;
config.reliable = true;
channel->Start(peer_connection_->CreateDataChannel(name, &config));

Powered by Google App Engine
This is Rietveld 408576698