| 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/base/event.h" |
| 22 #include "webrtc/system_wrappers/include/atomic32.h" | 23 #include "webrtc/system_wrappers/include/atomic32.h" |
| 23 #include "webrtc/system_wrappers/include/condition_variable_wrapper.h" | |
| 24 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | |
| 25 #include "webrtc/system_wrappers/include/event_wrapper.h" | 24 #include "webrtc/system_wrappers/include/event_wrapper.h" |
| 26 #include "webrtc/system_wrappers/include/rw_lock_wrapper.h" | 25 #include "webrtc/system_wrappers/include/rw_lock_wrapper.h" |
| 27 #include "webrtc/system_wrappers/include/trace.h" | 26 #include "webrtc/system_wrappers/include/trace.h" |
| 28 #include "webrtc/test/channel_transport/udp_socket2_manager_win.h" | 27 #include "webrtc/test/channel_transport/udp_socket2_manager_win.h" |
| 29 #include "webrtc/test/channel_transport/udp_socket_wrapper.h" | 28 #include "webrtc/test/channel_transport/udp_socket_wrapper.h" |
| 30 | 29 |
| 31 namespace webrtc { | 30 namespace webrtc { |
| 32 namespace test { | 31 namespace test { |
| 33 | 32 |
| 34 class UdpSocket2ManagerWindows; | 33 class UdpSocket2ManagerWindows; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 RWLockWrapper* _ptrCbRWLock; | 125 RWLockWrapper* _ptrCbRWLock; |
| 127 IncomingSocketCallback _incomingCb; | 126 IncomingSocketCallback _incomingCb; |
| 128 CallbackObj _obj; | 127 CallbackObj _obj; |
| 129 bool _qos; | 128 bool _qos; |
| 130 | 129 |
| 131 SocketAddress _remoteAddr; | 130 SocketAddress _remoteAddr; |
| 132 SOCKET _socket; | 131 SOCKET _socket; |
| 133 int32_t _iProtocol; | 132 int32_t _iProtocol; |
| 134 UdpSocket2ManagerWindows* _mgr; | 133 UdpSocket2ManagerWindows* _mgr; |
| 135 | 134 |
| 136 CriticalSectionWrapper* _pCrit; | |
| 137 Atomic32 _outstandingCalls; | 135 Atomic32 _outstandingCalls; |
| 138 Atomic32 _outstandingCallComplete; | 136 Atomic32 _outstandingCallComplete; |
| 139 volatile bool _terminate; | 137 volatile bool _terminate; |
| 140 volatile bool _addedToMgr; | 138 volatile bool _addedToMgr; |
| 141 | 139 |
| 142 CriticalSectionWrapper* _ptrDeleteCrit; | 140 rtc::Event delete_event_; |
| 143 ConditionVariableWrapper* _ptrDeleteCond; | |
| 144 bool _safeTodelete; | |
| 145 | 141 |
| 146 RWLockWrapper* _ptrDestRWLock; | 142 RWLockWrapper* _ptrDestRWLock; |
| 147 bool _outstandingCallsDisabled; | 143 bool _outstandingCallsDisabled; |
| 148 bool NewOutstandingCall(); | 144 bool NewOutstandingCall(); |
| 149 void OutstandingCallCompleted(); | 145 void OutstandingCallCompleted(); |
| 150 void DisableNewOutstandingCalls(); | 146 void DisableNewOutstandingCalls(); |
| 151 void WaitForOutstandingCalls(); | |
| 152 | 147 |
| 153 void RemoveSocketFromManager(); | 148 void RemoveSocketFromManager(); |
| 154 | 149 |
| 155 // RWLockWrapper is used as a reference counter for the socket. Write lock | 150 // RWLockWrapper is used as a reference counter for the socket. Write lock |
| 156 // is used for creating and deleting socket. Read lock is used for | 151 // is used for creating and deleting socket. Read lock is used for |
| 157 // accessing the socket. | 152 // accessing the socket. |
| 158 RWLockWrapper* _ptrSocketRWLock; | 153 RWLockWrapper* _ptrSocketRWLock; |
| 159 bool AquireSocket(); | 154 bool AquireSocket(); |
| 160 void ReleaseSocket(); | 155 void ReleaseSocket(); |
| 161 bool InvalidateSocket(); | 156 bool InvalidateSocket(); |
| 162 | 157 |
| 163 // Traffic control handles and structure pointers. | 158 // Traffic control handles and structure pointers. |
| 164 HANDLE _clientHandle; | 159 HANDLE _clientHandle; |
| 165 HANDLE _flowHandle; | 160 HANDLE _flowHandle; |
| 166 HANDLE _filterHandle; | 161 HANDLE _filterHandle; |
| 167 PTC_GEN_FLOW _flow; | 162 PTC_GEN_FLOW _flow; |
| 168 // TrafficControlWindows implements TOS and PCP. | 163 // TrafficControlWindows implements TOS and PCP. |
| 169 TrafficControlWindows* _gtc; | 164 TrafficControlWindows* _gtc; |
| 170 // Holds the current pcp value. Can be -2 or 0 - 7. | 165 // Holds the current pcp value. Can be -2 or 0 - 7. |
| 171 int _pcp; | 166 int _pcp; |
| 172 | 167 |
| 173 Atomic32 _receiveBuffers; | 168 Atomic32 _receiveBuffers; |
| 174 }; | 169 }; |
| 175 | 170 |
| 176 } // namespace test | 171 } // namespace test |
| 177 } // namespace webrtc | 172 } // namespace webrtc |
| 178 | 173 |
| 179 #endif // WEBRTC_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ | 174 #endif // WEBRTC_TEST_CHANNEL_TRANSPORT_UDP_SOCKET2_WINDOWS_H_ |
| OLD | NEW |