ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / renderer / p2p / port_allocator.h
blob057f37bb6dcf8f08331f797ec57aa0b31eb37300
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_
6 #define CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_
8 #include "third_party/webrtc/p2p/client/basicportallocator.h"
10 namespace content {
12 class P2PPortAllocatorSession;
13 class P2PSocketDispatcher;
15 class P2PPortAllocator : public cricket::BasicPortAllocator {
16 public:
17 struct Config {
18 Config();
19 ~Config();
21 struct RelayServerConfig {
22 RelayServerConfig();
23 ~RelayServerConfig();
25 std::string username;
26 std::string password;
27 std::string server_address;
28 int port;
29 std::string transport_type;
30 bool secure;
33 std::set<rtc::SocketAddress> stun_servers;
35 std::vector<RelayServerConfig> relays;
37 // Disable TCP-based transport when set to true.
38 bool disable_tcp_transport;
40 // Disable binding to individual NICs when set to false.
41 bool enable_multiple_routes;
44 P2PPortAllocator(P2PSocketDispatcher* socket_dispatcher,
45 rtc::NetworkManager* network_manager,
46 rtc::PacketSocketFactory* socket_factory,
47 const Config& config);
48 ~P2PPortAllocator() override;
50 cricket::PortAllocatorSession* CreateSessionInternal(
51 const std::string& content_name,
52 int component,
53 const std::string& ice_username_fragment,
54 const std::string& ice_password) override;
56 private:
57 friend class P2PPortAllocatorSession;
59 P2PSocketDispatcher* socket_dispatcher_;
60 Config config_;
62 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocator);
65 class P2PPortAllocatorSession : public cricket::BasicPortAllocatorSession {
66 public:
67 P2PPortAllocatorSession(
68 P2PPortAllocator* allocator,
69 const std::string& content_name,
70 int component,
71 const std::string& ice_username_fragment,
72 const std::string& ice_password);
73 ~P2PPortAllocatorSession() override;
75 protected:
76 // Overrides for cricket::BasicPortAllocatorSession.
77 void GetPortConfigurations() override;
79 private:
80 P2PPortAllocator* allocator_;
82 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocatorSession);
85 } // namespace content
87 #endif // CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_