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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 if (!stun_address_.IsUnresolved()) { | 149 if (!stun_address_.IsUnresolved()) { |
150 return; | 150 return; |
151 } | 151 } |
152 | 152 |
153 std::string hostname = stun_address_.hostname(); | 153 std::string hostname = stun_address_.hostname(); |
154 uint16 port = stun_address_.port(); | 154 uint16 port = stun_address_.port(); |
155 | 155 |
156 PP_HostResolver_Private_Hint hint; | 156 PP_HostResolver_Private_Hint hint; |
157 hint.flags = 0; | 157 hint.flags = 0; |
158 hint.family = PP_NETADDRESSFAMILY_IPV4; | 158 hint.family = PP_NETADDRESSFAMILY_PRIVATE_IPV4; |
159 int result = stun_address_resolver_.Resolve( | 159 int result = stun_address_resolver_.Resolve( |
160 hostname, port, hint, | 160 hostname, port, hint, |
161 PpCompletionCallback(base::Bind( | 161 PpCompletionCallback(base::Bind( |
162 &PepperPortAllocatorSession::OnStunAddressResolved, | 162 &PepperPortAllocatorSession::OnStunAddressResolved, |
163 weak_factory_.GetWeakPtr()))); | 163 weak_factory_.GetWeakPtr()))); |
164 | 164 |
165 DCHECK_EQ(result, PP_OK_COMPLETIONPENDING); | 165 DCHECK_EQ(result, PP_OK_COMPLETIONPENDING); |
166 } | 166 } |
167 | 167 |
168 void PepperPortAllocatorSession::OnStunAddressResolved(int32_t result) { | 168 void PepperPortAllocatorSession::OnStunAddressResolved(int32_t result) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 const std::string& content_name, | 332 const std::string& content_name, |
333 int component, | 333 int component, |
334 const std::string& ice_username_fragment, | 334 const std::string& ice_username_fragment, |
335 const std::string& ice_password) { | 335 const std::string& ice_password) { |
336 return new PepperPortAllocatorSession( | 336 return new PepperPortAllocatorSession( |
337 this, content_name, component, ice_username_fragment, ice_password, | 337 this, content_name, component, ice_username_fragment, ice_password, |
338 stun_hosts(), relay_hosts(), relay_token(), instance_); | 338 stun_hosts(), relay_hosts(), relay_token(), instance_); |
339 } | 339 } |
340 | 340 |
341 } // namespace remoting | 341 } // namespace remoting |
OLD | NEW |