Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "remoting/protocol/pepper_transport_factory.h" | 5 #include "remoting/protocol/pepper_transport_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "crypto/hmac.h" | 8 #include "crypto/hmac.h" |
| 9 #include "jingle/glue/utils.h" | 9 #include "jingle/glue/utils.h" |
| 10 #include "net/base/cert_status_flags.h" | 10 #include "net/base/cert_status_flags.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 if (transport->SetProperty(PP_TRANSPORTPROPERTY_TCP_NO_DELAY, | 142 if (transport->SetProperty(PP_TRANSPORTPROPERTY_TCP_NO_DELAY, |
| 143 pp::Var(true)) != PP_OK) { | 143 pp::Var(true)) != PP_OK) { |
| 144 LOG(ERROR) << "Failed to set TCP_NODELAY"; | 144 LOG(ERROR) << "Failed to set TCP_NODELAY"; |
| 145 } | 145 } |
| 146 | 146 |
| 147 if (transport->SetProperty(PP_TRANSPORTPROPERTY_TCP_ACK_DELAY, | 147 if (transport->SetProperty(PP_TRANSPORTPROPERTY_TCP_ACK_DELAY, |
| 148 pp::Var(kTcpAckDelayMilliseconds)) != PP_OK) { | 148 pp::Var(kTcpAckDelayMilliseconds)) != PP_OK) { |
| 149 LOG(ERROR) << "Failed to set TCP ACK delay."; | 149 LOG(ERROR) << "Failed to set TCP ACK delay."; |
| 150 } | 150 } |
| 151 | 151 |
| 152 if (config_.nat_traversal_mode == TransportConfig::NAT_TRAVERSAL_ENABLED) { | 152 if (transport->SetProperty( |
|
Wez
2012/04/27 17:58:51
This test seems to be going away because Transport
Sergey Ulanov
2012/04/27 22:51:14
Currently TransportConfig comes from the signaling
| |
| 153 if (transport->SetProperty( | 153 PP_TRANSPORTPROPERTY_STUN_SERVER, |
| 154 PP_TRANSPORTPROPERTY_STUN_SERVER, | 154 pp::Var(config_.stun_server)) != PP_OK) { |
| 155 pp::Var(config_.stun_server)) != PP_OK) { | 155 LOG(ERROR) << "Failed to set STUN server."; |
| 156 LOG(ERROR) << "Failed to set STUN server."; | 156 } |
| 157 } | |
| 158 | 157 |
| 159 if (transport->SetProperty( | 158 if (transport->SetProperty( |
| 160 PP_TRANSPORTPROPERTY_RELAY_SERVER, | 159 PP_TRANSPORTPROPERTY_RELAY_SERVER, |
| 161 pp::Var(config_.relay_server)) != PP_OK) { | 160 pp::Var(config_.relay_server)) != PP_OK) { |
| 162 LOG(ERROR) << "Failed to set relay server."; | 161 LOG(ERROR) << "Failed to set relay server."; |
| 163 } | 162 } |
| 164 | 163 |
| 165 if (transport->SetProperty( | 164 if (transport->SetProperty( |
| 166 PP_TRANSPORTPROPERTY_RELAY_USERNAME, | 165 PP_TRANSPORTPROPERTY_RELAY_USERNAME, |
| 167 pp::Var("1")) != PP_OK) { | 166 pp::Var("1")) != PP_OK) { |
| 168 LOG(ERROR) << "Failed to set relay username."; | 167 LOG(ERROR) << "Failed to set relay username."; |
| 169 } | 168 } |
| 170 | 169 |
| 171 if (transport->SetProperty( | 170 if (transport->SetProperty( |
| 172 PP_TRANSPORTPROPERTY_RELAY_PASSWORD, | 171 PP_TRANSPORTPROPERTY_RELAY_PASSWORD, |
| 173 pp::Var(config_.relay_token)) != PP_OK) { | 172 pp::Var(config_.relay_token)) != PP_OK) { |
| 174 LOG(ERROR) << "Failed to set relay token."; | 173 LOG(ERROR) << "Failed to set relay token."; |
| 175 } | 174 } |
| 176 | 175 |
| 177 if (transport->SetProperty( | 176 if (transport->SetProperty( |
| 178 PP_TRANSPORTPROPERTY_RELAY_MODE, | 177 PP_TRANSPORTPROPERTY_RELAY_MODE, |
| 179 pp::Var(PP_TRANSPORTRELAYMODE_GOOGLE)) != PP_OK) { | 178 pp::Var(PP_TRANSPORTRELAYMODE_GOOGLE)) != PP_OK) { |
| 180 LOG(ERROR) << "Failed to set relay mode."; | 179 LOG(ERROR) << "Failed to set relay mode."; |
| 181 } | |
| 182 } | 180 } |
| 183 | 181 |
| 184 if (transport->SetProperty(PP_TRANSPORTPROPERTY_DISABLE_TCP_TRANSPORT, | 182 if (transport->SetProperty(PP_TRANSPORTPROPERTY_DISABLE_TCP_TRANSPORT, |
| 185 pp::Var(true)) != PP_OK) { | 183 pp::Var(true)) != PP_OK) { |
| 186 LOG(ERROR) << "Failed to set DISABLE_TCP_TRANSPORT flag."; | 184 LOG(ERROR) << "Failed to set DISABLE_TCP_TRANSPORT flag."; |
| 187 } | 185 } |
| 188 | 186 |
| 189 channel_ = new PepperTransportSocketAdapter(transport, name_, this); | 187 channel_ = new PepperTransportSocketAdapter(transport, name_, this); |
| 190 owned_channel_.reset(channel_); | 188 owned_channel_.reset(channel_); |
| 191 | 189 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 } | 285 } |
| 288 | 286 |
| 289 scoped_ptr<DatagramTransport> | 287 scoped_ptr<DatagramTransport> |
| 290 PepperTransportFactory::CreateDatagramTransport() { | 288 PepperTransportFactory::CreateDatagramTransport() { |
| 291 NOTIMPLEMENTED(); | 289 NOTIMPLEMENTED(); |
| 292 return scoped_ptr<DatagramTransport>(NULL); | 290 return scoped_ptr<DatagramTransport>(NULL); |
| 293 } | 291 } |
| 294 | 292 |
| 295 } // namespace protocol | 293 } // namespace protocol |
| 296 } // namespace remoting | 294 } // namespace remoting |
| OLD | NEW |