| 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 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_ | 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ppapi/cpp/instance_handle.h" | 10 #include "ppapi/cpp/instance_handle.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // addresses to BasicPortAllocator (it uses HostResolverPrivate API | 21 // addresses to BasicPortAllocator (it uses HostResolverPrivate API |
| 22 // for that). This is needed because libjingle's DNS resolution | 22 // for that). This is needed because libjingle's DNS resolution |
| 23 // code doesn't work in sandbox. | 23 // code doesn't work in sandbox. |
| 24 class PepperPortAllocator : public cricket::HttpPortAllocatorBase { | 24 class PepperPortAllocator : public cricket::HttpPortAllocatorBase { |
| 25 public: | 25 public: |
| 26 static scoped_ptr<PepperPortAllocator> Create( | 26 static scoped_ptr<PepperPortAllocator> Create( |
| 27 const pp::InstanceHandle& instance); | 27 const pp::InstanceHandle& instance); |
| 28 virtual ~PepperPortAllocator(); | 28 virtual ~PepperPortAllocator(); |
| 29 | 29 |
| 30 // cricket::HttpPortAllocatorBase overrides. | 30 // cricket::HttpPortAllocatorBase overrides. |
| 31 virtual cricket::PortAllocatorSession* CreateSession( | 31 virtual cricket::PortAllocatorSession* CreateSessionInternal( |
| 32 const std::string& channel_name, | 32 int component, |
| 33 int component) OVERRIDE; | 33 const std::string& ice_username_fragment, |
| 34 const std::string& ice_password) OVERRIDE; |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 PepperPortAllocator( | 37 PepperPortAllocator( |
| 37 const pp::InstanceHandle& instance, | 38 const pp::InstanceHandle& instance, |
| 38 scoped_ptr<talk_base::NetworkManager> network_manager, | 39 scoped_ptr<talk_base::NetworkManager> network_manager, |
| 39 scoped_ptr<talk_base::PacketSocketFactory> socket_factory); | 40 scoped_ptr<talk_base::PacketSocketFactory> socket_factory); |
| 40 | 41 |
| 41 pp::InstanceHandle instance_; | 42 pp::InstanceHandle instance_; |
| 42 scoped_ptr<talk_base::NetworkManager> network_manager_; | 43 scoped_ptr<talk_base::NetworkManager> network_manager_; |
| 43 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; | 44 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(PepperPortAllocator); | 46 DISALLOW_COPY_AND_ASSIGN(PepperPortAllocator); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace remoting | 49 } // namespace remoting |
| 49 | 50 |
| 50 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_ | 51 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_ |
| OLD | NEW |