Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1193)

Side by Side Diff: webrtc/p2p/base/basicpacketsocketfactory.h

Issue 1556743002: Bind a socket to a network if the network handle is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_P2P_BASE_BASICPACKETSOCKETFACTORY_H_ 11 #ifndef WEBRTC_P2P_BASE_BASICPACKETSOCKETFACTORY_H_
12 #define WEBRTC_P2P_BASE_BASICPACKETSOCKETFACTORY_H_ 12 #define WEBRTC_P2P_BASE_BASICPACKETSOCKETFACTORY_H_
13 13
14 #include "webrtc/p2p/base/packetsocketfactory.h" 14 #include "webrtc/p2p/base/packetsocketfactory.h"
15 15
16 namespace rtc { 16 namespace rtc {
17 17
18 class AsyncSocket; 18 class AsyncSocket;
19 class Network;
19 class SocketFactory; 20 class SocketFactory;
20 class Thread; 21 class Thread;
21 22
22 class BasicPacketSocketFactory : public PacketSocketFactory { 23 class BasicPacketSocketFactory : public PacketSocketFactory {
23 public: 24 public:
24 BasicPacketSocketFactory(); 25 BasicPacketSocketFactory();
25 explicit BasicPacketSocketFactory(Thread* thread); 26 explicit BasicPacketSocketFactory(Thread* thread);
26 explicit BasicPacketSocketFactory(SocketFactory* socket_factory); 27 explicit BasicPacketSocketFactory(SocketFactory* socket_factory);
27 ~BasicPacketSocketFactory() override; 28 ~BasicPacketSocketFactory() override;
28 29
29 AsyncPacketSocket* CreateUdpSocket(const SocketAddress& local_address, 30 AsyncPacketSocket* CreateUdpSocket(const SocketAddress& local_address,
30 uint16_t min_port, 31 uint16_t min_port,
31 uint16_t max_port) override; 32 uint16_t max_port) override;
33 AsyncPacketSocket* CreateUdpSocketOnNetwork(
34 const SocketAddress& local_address,
35 uint16_t min_port,
36 uint16_t max_port,
37 const Network* network) override;
32 AsyncPacketSocket* CreateServerTcpSocket(const SocketAddress& local_address, 38 AsyncPacketSocket* CreateServerTcpSocket(const SocketAddress& local_address,
33 uint16_t min_port, 39 uint16_t min_port,
34 uint16_t max_port, 40 uint16_t max_port,
35 int opts) override; 41 int opts) override;
36 AsyncPacketSocket* CreateClientTcpSocket(const SocketAddress& local_address, 42 AsyncPacketSocket* CreateClientTcpSocket(const SocketAddress& local_address,
37 const SocketAddress& remote_address, 43 const SocketAddress& remote_address,
38 const ProxyInfo& proxy_info, 44 const ProxyInfo& proxy_info,
39 const std::string& user_agent, 45 const std::string& user_agent,
40 int opts) override; 46 int opts) override;
41 47
42 AsyncResolverInterface* CreateAsyncResolver() override; 48 AsyncResolverInterface* CreateAsyncResolver() override;
43 49
44 private: 50 private:
45 int BindSocket(AsyncSocket* socket, 51 int BindSocket(AsyncSocket* socket,
46 const SocketAddress& local_address, 52 const SocketAddress& local_address,
47 uint16_t min_port, 53 uint16_t min_port,
48 uint16_t max_port); 54 uint16_t max_port);
49 55
50 SocketFactory* socket_factory(); 56 SocketFactory* socket_factory();
51 57
52 Thread* thread_; 58 Thread* thread_;
53 SocketFactory* socket_factory_; 59 SocketFactory* socket_factory_;
54 }; 60 };
55 61
56 } // namespace rtc 62 } // namespace rtc
57 63
58 #endif // WEBRTC_P2P_BASE_BASICPACKETSOCKETFACTORY_H_ 64 #endif // WEBRTC_P2P_BASE_BASICPACKETSOCKETFACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698