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/client/plugin/pepper_port_allocator.h" | 5 #include "remoting/client/plugin/pepper_port_allocator.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "net/base/net_util.h" | 8 #include "net/base/net_util.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/cpp/completion_callback.h" | 10 #include "ppapi/cpp/completion_callback.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 PepperPortAllocatorSession::PepperPortAllocatorSession( | 75 PepperPortAllocatorSession::PepperPortAllocatorSession( |
| 76 cricket::HttpPortAllocatorBase* allocator, | 76 cricket::HttpPortAllocatorBase* allocator, |
| 77 int component, | 77 int component, |
| 78 const std::string& ice_username_fragment, | 78 const std::string& ice_username_fragment, |
| 79 const std::string& ice_password, | 79 const std::string& ice_password, |
| 80 const std::vector<talk_base::SocketAddress>& stun_hosts, | 80 const std::vector<talk_base::SocketAddress>& stun_hosts, |
| 81 const std::vector<std::string>& relay_hosts, | 81 const std::vector<std::string>& relay_hosts, |
| 82 const std::string& relay_token, | 82 const std::string& relay_token, |
| 83 const pp::InstanceHandle& instance) | 83 const pp::InstanceHandle& instance) |
| 84 : HttpPortAllocatorSessionBase( | 84 : HttpPortAllocatorSessionBase( |
| 85 allocator, component, ice_username_fragment, ice_password, | 85 allocator, "", component, ice_username_fragment, ice_password, |
| 86 stun_hosts, relay_hosts, relay_token, ""), | 86 stun_hosts, relay_hosts, relay_token, ""), |
| 87 instance_(instance), | 87 instance_(instance), |
| 88 stun_address_resolver_(instance_), | 88 stun_address_resolver_(instance_), |
| 89 stun_port_(0), | 89 stun_port_(0), |
| 90 relay_response_received_(false) { | 90 relay_response_received_(false) { |
| 91 if (stun_hosts.size() > 0) { | 91 if (stun_hosts.size() > 0) { |
| 92 stun_address_ = stun_hosts[0]; | 92 stun_address_ = stun_hosts[0]; |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 // username fragment is shared between all candidates for this | 329 // username fragment is shared between all candidates for this |
| 330 // channel. | 330 // channel. |
| 331 set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | | 331 set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | |
| 332 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); | 332 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); |
| 333 } | 333 } |
| 334 | 334 |
| 335 PepperPortAllocator::~PepperPortAllocator() { | 335 PepperPortAllocator::~PepperPortAllocator() { |
| 336 } | 336 } |
| 337 | 337 |
| 338 cricket::PortAllocatorSession* PepperPortAllocator::CreateSessionInternal( | 338 cricket::PortAllocatorSession* PepperPortAllocator::CreateSessionInternal( |
| 339 const std::string& content_name, | |
| 339 int component, | 340 int component, |
| 340 const std::string& ice_username_fragment, | 341 const std::string& ice_username_fragment, |
| 341 const std::string& ice_password) { | 342 const std::string& ice_password) { |
| 342 return new PepperPortAllocatorSession( | 343 return new PepperPortAllocatorSession( |
| 343 this, component, ice_username_fragment, ice_password, | 344 this, component, ice_username_fragment, ice_password, |
|
Sergey Ulanov
2012/07/13 01:22:48
do we need to pass content_name to PepperPortAlloc
Ronghua Wu (Left Chromium)
2012/07/13 18:26:35
Done.
| |
| 344 stun_hosts(), relay_hosts(), relay_token(), instance_); | 345 stun_hosts(), relay_hosts(), relay_token(), instance_); |
| 345 } | 346 } |
| 346 | 347 |
| 347 } // namespace remoting | 348 } // namespace remoting |
| OLD | NEW |