OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ | 11 #ifndef WEBRTC_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ |
12 #define WEBRTC_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ | 12 #define WEBRTC_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ |
13 | 13 |
14 // Disable deprication warning from traffic.h | 14 // Disable deprication warning from traffic.h |
15 #pragma warning(disable : 4995) | 15 #pragma warning(disable : 4995) |
16 | 16 |
17 // Don't change include order for these header files. | 17 // Don't change include order for these header files. |
18 #include <Winsock2.h> | 18 #include <Winsock2.h> |
19 #include <Ntddndis.h> | 19 #include <Ntddndis.h> |
20 #include <traffic.h> | 20 #include <traffic.h> |
21 | 21 |
22 #include "webrtc/system_wrappers/interface/atomic32.h" | 22 #include "webrtc/base/atomicops.h" |
23 #include "webrtc/system_wrappers/interface/condition_variable_wrapper.h" | 23 #include "webrtc/system_wrappers/interface/condition_variable_wrapper.h" |
24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 24 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
25 #include "webrtc/system_wrappers/interface/event_wrapper.h" | 25 #include "webrtc/system_wrappers/interface/event_wrapper.h" |
26 #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" | 26 #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" |
27 #include "webrtc/system_wrappers/interface/trace.h" | 27 #include "webrtc/system_wrappers/interface/trace.h" |
28 #include "webrtc/test/channel_transport/udp_socket2_manager_win.h" | 28 #include "webrtc/test/channel_transport/udp_socket2_manager_win.h" |
29 #include "webrtc/test/channel_transport/udp_socket_wrapper.h" | 29 #include "webrtc/test/channel_transport/udp_socket_wrapper.h" |
30 | 30 |
31 namespace webrtc { | 31 namespace webrtc { |
32 namespace test { | 32 namespace test { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 int32_t bucketSize, | 69 int32_t bucketSize, |
70 int32_t peekBandwith, | 70 int32_t peekBandwith, |
71 int32_t minPolicedSize, | 71 int32_t minPolicedSize, |
72 int32_t maxSduSize, | 72 int32_t maxSduSize, |
73 const SocketAddress& stRemName, | 73 const SocketAddress& stRemName, |
74 int32_t overrideDSCP = 0) override; | 74 int32_t overrideDSCP = 0) override; |
75 | 75 |
76 int32_t SetTOS(const int32_t serviceType) override; | 76 int32_t SetTOS(const int32_t serviceType) override; |
77 int32_t SetPCP(const int32_t pcp) override; | 77 int32_t SetPCP(const int32_t pcp) override; |
78 | 78 |
79 uint32_t ReceiveBuffers() override { return _receiveBuffers.Value(); } | 79 uint32_t ReceiveBuffers() override { |
| 80 return rtc::AtomicOps::AcquireLoad(&_receiveBuffers); |
| 81 } |
80 | 82 |
81 protected: | 83 protected: |
82 void IOCompleted(PerIoContext* pIOContext, uint32_t ioSize, uint32_t error); | 84 void IOCompleted(PerIoContext* pIOContext, uint32_t ioSize, uint32_t error); |
83 | 85 |
84 int32_t PostRecv(); | 86 int32_t PostRecv(); |
85 // Use pIoContext to post a new WSARecvFrom(..). | 87 // Use pIoContext to post a new WSARecvFrom(..). |
86 int32_t PostRecv(PerIoContext* pIoContext); | 88 int32_t PostRecv(PerIoContext* pIoContext); |
87 | 89 |
88 private: | 90 private: |
89 friend class UdpSocket2WorkerWindows; | 91 friend class UdpSocket2WorkerWindows; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 IncomingSocketCallback _incomingCb; | 129 IncomingSocketCallback _incomingCb; |
128 CallbackObj _obj; | 130 CallbackObj _obj; |
129 bool _qos; | 131 bool _qos; |
130 | 132 |
131 SocketAddress _remoteAddr; | 133 SocketAddress _remoteAddr; |
132 SOCKET _socket; | 134 SOCKET _socket; |
133 int32_t _iProtocol; | 135 int32_t _iProtocol; |
134 UdpSocket2ManagerWindows* _mgr; | 136 UdpSocket2ManagerWindows* _mgr; |
135 | 137 |
136 CriticalSectionWrapper* _pCrit; | 138 CriticalSectionWrapper* _pCrit; |
137 Atomic32 _outstandingCalls; | 139 volatile int _outstandingCalls; |
138 Atomic32 _outstandingCallComplete; | 140 volatile int _outstandingCallComplete; |
139 volatile bool _terminate; | 141 volatile bool _terminate; |
140 volatile bool _addedToMgr; | 142 volatile bool _addedToMgr; |
141 | 143 |
142 CriticalSectionWrapper* _ptrDeleteCrit; | 144 CriticalSectionWrapper* _ptrDeleteCrit; |
143 ConditionVariableWrapper* _ptrDeleteCond; | 145 ConditionVariableWrapper* _ptrDeleteCond; |
144 bool _safeTodelete; | 146 bool _safeTodelete; |
145 | 147 |
146 RWLockWrapper* _ptrDestRWLock; | 148 RWLockWrapper* _ptrDestRWLock; |
147 bool _outstandingCallsDisabled; | 149 bool _outstandingCallsDisabled; |
148 bool NewOutstandingCall(); | 150 bool NewOutstandingCall(); |
(...skipping 14 matching lines...) Expand all Loading... |
163 // Traffic control handles and structure pointers. | 165 // Traffic control handles and structure pointers. |
164 HANDLE _clientHandle; | 166 HANDLE _clientHandle; |
165 HANDLE _flowHandle; | 167 HANDLE _flowHandle; |
166 HANDLE _filterHandle; | 168 HANDLE _filterHandle; |
167 PTC_GEN_FLOW _flow; | 169 PTC_GEN_FLOW _flow; |
168 // TrafficControlWindows implements TOS and PCP. | 170 // TrafficControlWindows implements TOS and PCP. |
169 TrafficControlWindows* _gtc; | 171 TrafficControlWindows* _gtc; |
170 // Holds the current pcp value. Can be -2 or 0 - 7. | 172 // Holds the current pcp value. Can be -2 or 0 - 7. |
171 int _pcp; | 173 int _pcp; |
172 | 174 |
173 Atomic32 _receiveBuffers; | 175 volatile int _receiveBuffers; |
174 }; | 176 }; |
175 | 177 |
176 } // namespace test | 178 } // namespace test |
177 } // namespace webrtc | 179 } // namespace webrtc |
178 | 180 |
179 #endif // WEBRTC_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ | 181 #endif // WEBRTC_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ |
OLD | NEW |