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

Side by Side Diff: webrtc/api/ortc/udptransportinterface.h

Issue 2675173003: Adding "adapter" ORTC objects on top of ChannelManager/BaseChannel/etc. (Closed)
Patch Set: Add memcheck suppression for end-to-end tests. Created 3 years, 9 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
« no previous file with comments | « webrtc/api/ortc/rtptransportinterface.h ('k') | webrtc/api/ortcfactoryinterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 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_API_UDPTRANSPORTINTERFACE_H_ 11 #ifndef WEBRTC_API_ORTC_UDPTRANSPORTINTERFACE_H_
12 #define WEBRTC_API_UDPTRANSPORTINTERFACE_H_ 12 #define WEBRTC_API_ORTC_UDPTRANSPORTINTERFACE_H_
13 13
14 #include "webrtc/api/ortc/packettransportinterface.h"
14 #include "webrtc/api/proxy.h" 15 #include "webrtc/api/proxy.h"
15 #include "webrtc/base/socketaddress.h" 16 #include "webrtc/base/socketaddress.h"
16 17
17 namespace webrtc { 18 namespace webrtc {
18 19
19 // Interface for a raw UDP transport (not using ICE), meaning a combination of 20 // Interface for a raw UDP transport (not using ICE), meaning a combination of
20 // a local/remote IP address/port. 21 // a local/remote IP address/port.
21 // 22 //
22 // An instance can be instantiated using OrtcFactory. 23 // An instance can be instantiated using OrtcFactory.
23 // 24 //
24 // Each instance reserves a UDP port, which will be freed when the 25 // Each instance reserves a UDP port, which will be freed when the
25 // UdpTransportInterface destructor is called. 26 // UdpTransportInterface destructor is called.
26 // 27 //
27 // Calling SetRemoteAddress sets the destination of outgoing packets; without a 28 // Calling SetRemoteAddress sets the destination of outgoing packets; without a
28 // destination, packets can't be sent, but they can be received. 29 // destination, packets can't be sent, but they can be received.
29 class UdpTransportInterface { 30 class UdpTransportInterface : virtual public PacketTransportInterface {
30 public: 31 public:
31 virtual ~UdpTransportInterface() {}
32
33 // Get the address of the socket allocated for this transport. 32 // Get the address of the socket allocated for this transport.
34 virtual rtc::SocketAddress GetLocalAddress() const = 0; 33 virtual rtc::SocketAddress GetLocalAddress() const = 0;
35 34
36 // Sets the address to which packets will be delivered. 35 // Sets the address to which packets will be delivered.
37 // 36 //
38 // Calling with a "nil" (default-constructed) address is legal, and unsets 37 // Calling with a "nil" (default-constructed) address is legal, and unsets
39 // any previously set destination. 38 // any previously set destination.
40 // 39 //
41 // However, calling with an incomplete address (port or IP not set) will 40 // However, calling with an incomplete address (port or IP not set) will
42 // fail. 41 // fail.
43 virtual bool SetRemoteAddress(const rtc::SocketAddress& dest) = 0; 42 virtual bool SetRemoteAddress(const rtc::SocketAddress& dest) = 0;
44 // Simple getter. If never set, returns nil address. 43 // Simple getter. If never set, returns nil address.
45 virtual rtc::SocketAddress GetRemoteAddress() const = 0; 44 virtual rtc::SocketAddress GetRemoteAddress() const = 0;
46 }; 45 };
47 46
48 // TODO(deadbeef): Move this to .cc file and out of api/. What threads methods
49 // are called on is an implementation detail.
50 BEGIN_OWNED_PROXY_MAP(UdpTransport)
51 PROXY_WORKER_THREAD_DESTRUCTOR()
52 PROXY_WORKER_CONSTMETHOD0(rtc::SocketAddress, GetLocalAddress)
53 PROXY_WORKER_METHOD1(bool, SetRemoteAddress, const rtc::SocketAddress&)
54 PROXY_WORKER_CONSTMETHOD0(rtc::SocketAddress, GetRemoteAddress)
55 END_PROXY_MAP()
56
57 } // namespace webrtc 47 } // namespace webrtc
58 48
59 #endif // WEBRTC_API_UDPTRANSPORTINTERFACE_H_ 49 #endif // WEBRTC_API_ORTC_UDPTRANSPORTINTERFACE_H_
OLDNEW
« no previous file with comments | « webrtc/api/ortc/rtptransportinterface.h ('k') | webrtc/api/ortcfactoryinterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698