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" |
11 #include "ppapi/cpp/host_resolver.h" | 11 #include "ppapi/cpp/host_resolver.h" |
12 #include "ppapi/cpp/net_address.h" | 12 #include "ppapi/cpp/net_address.h" |
13 #include "ppapi/cpp/url_loader.h" | 13 #include "ppapi/cpp/url_loader.h" |
14 #include "ppapi/cpp/url_request_info.h" | 14 #include "ppapi/cpp/url_request_info.h" |
15 #include "ppapi/cpp/url_response_info.h" | 15 #include "ppapi/cpp/url_response_info.h" |
16 #include "ppapi/utility/completion_callback_factory.h" | 16 #include "ppapi/utility/completion_callback_factory.h" |
17 #include "remoting/client/plugin/pepper_network_manager.h" | 17 #include "remoting/client/plugin/pepper_network_manager.h" |
18 #include "remoting/client/plugin/pepper_packet_socket_factory.h" | 18 #include "remoting/client/plugin/pepper_packet_socket_factory.h" |
19 #include "remoting/client/plugin/pepper_util.h" | 19 #include "remoting/client/plugin/pepper_util.h" |
20 | 20 |
21 namespace remoting { | 21 namespace remoting { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // URL used to create a relay session. | |
26 const char kCreateRelaySessionURL[] = "/create_session"; | |
27 | |
28 // Read buffer we allocate per read when reading response from | 25 // Read buffer we allocate per read when reading response from |
29 // URLLoader. Normally the response from URL loader is smaller than 1kB. | 26 // URLLoader. Normally the response from URL loader is smaller than 1kB. |
30 const int kReadSize = 1024; | 27 const int kReadSize = 1024; |
31 | 28 |
32 class PepperPortAllocatorSession | 29 class PepperPortAllocatorSession |
33 : public cricket::HttpPortAllocatorSessionBase { | 30 : public cricket::HttpPortAllocatorSessionBase { |
34 public: | 31 public: |
35 PepperPortAllocatorSession( | 32 PepperPortAllocatorSession( |
36 cricket::HttpPortAllocatorBase* allocator, | 33 cricket::HttpPortAllocatorBase* allocator, |
37 const std::string& content_name, | 34 const std::string& content_name, |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 const std::string& content_name, | 328 const std::string& content_name, |
332 int component, | 329 int component, |
333 const std::string& ice_username_fragment, | 330 const std::string& ice_username_fragment, |
334 const std::string& ice_password) { | 331 const std::string& ice_password) { |
335 return new PepperPortAllocatorSession( | 332 return new PepperPortAllocatorSession( |
336 this, content_name, component, ice_username_fragment, ice_password, | 333 this, content_name, component, ice_username_fragment, ice_password, |
337 stun_hosts(), relay_hosts(), relay_token(), instance_); | 334 stun_hosts(), relay_hosts(), relay_token(), instance_); |
338 } | 335 } |
339 | 336 |
340 } // namespace remoting | 337 } // namespace remoting |
OLD | NEW |