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 CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ | 5 #ifndef CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
6 #define CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ | 6 #define CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // to generate a single local candidate. TODO(guoweis): Rename this to | 31 // to generate a single local candidate. TODO(guoweis): Rename this to |
32 // |request_multiple_routes|. | 32 // |request_multiple_routes|. |
33 bool enable_multiple_routes = true; | 33 bool enable_multiple_routes = true; |
34 | 34 |
35 // Enable exposing the default local address when set to true. This is | 35 // Enable exposing the default local address when set to true. This is |
36 // only in effect when the |enable_multiple_routes| is false or the | 36 // only in effect when the |enable_multiple_routes| is false or the |
37 // permission check of mic/camera is denied. | 37 // permission check of mic/camera is denied. |
38 bool enable_default_local_candidate = true; | 38 bool enable_default_local_candidate = true; |
39 }; | 39 }; |
40 | 40 |
41 P2PPortAllocator( | 41 P2PPortAllocator(const scoped_refptr<P2PSocketDispatcher>& socket_dispatcher, |
42 const scoped_refptr<P2PSocketDispatcher>& socket_dispatcher, | 42 std::unique_ptr<rtc::NetworkManager> network_manager, |
43 std::unique_ptr<rtc::NetworkManager> network_manager, | 43 rtc::PacketSocketFactory* socket_factory, |
44 rtc::PacketSocketFactory* socket_factory, | 44 const Config& config, |
45 const Config& config, | 45 const GURL& origin); |
46 const GURL& origin, | |
47 const scoped_refptr<base::SingleThreadTaskRunner> task_runner); | |
48 ~P2PPortAllocator() override; | 46 ~P2PPortAllocator() override; |
49 | 47 |
50 private: | 48 private: |
51 std::unique_ptr<rtc::NetworkManager> network_manager_; | 49 std::unique_ptr<rtc::NetworkManager> network_manager_; |
52 scoped_refptr<P2PSocketDispatcher> socket_dispatcher_; | 50 scoped_refptr<P2PSocketDispatcher> socket_dispatcher_; |
53 Config config_; | 51 Config config_; |
54 GURL origin_; | 52 GURL origin_; |
55 | 53 |
56 // This is the thread |network_manager_| is associated with and must be used | |
57 // to delete |network_manager_|. | |
58 const scoped_refptr<base::SingleThreadTaskRunner> | |
59 network_manager_task_runner_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocator); | 54 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocator); |
62 }; | 55 }; |
63 | 56 |
64 } // namespace content | 57 } // namespace content |
65 | 58 |
66 #endif // CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ | 59 #endif // CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
OLD | NEW |