OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // Win32Thread. Automatically pumps Windows messages. | 136 // Win32Thread. Automatically pumps Windows messages. |
137 /////////////////////////////////////////////////////////////////////////////// | 137 /////////////////////////////////////////////////////////////////////////////// |
138 | 138 |
139 class Win32Thread : public Thread { | 139 class Win32Thread : public Thread { |
140 public: | 140 public: |
141 Win32Thread() : ss_(this), id_(0) { | 141 Win32Thread() : ss_(this), id_(0) { |
142 set_socketserver(&ss_); | 142 set_socketserver(&ss_); |
143 } | 143 } |
144 virtual ~Win32Thread() { | 144 virtual ~Win32Thread() { |
145 Stop(); | 145 Stop(); |
146 set_socketserver(NULL); | 146 set_socketserver(nullptr); |
147 } | 147 } |
148 virtual void Run() { | 148 virtual void Run() { |
149 id_ = GetCurrentThreadId(); | 149 id_ = GetCurrentThreadId(); |
150 Thread::Run(); | 150 Thread::Run(); |
151 id_ = 0; | 151 id_ = 0; |
152 } | 152 } |
153 virtual void Quit() { | 153 virtual void Quit() { |
154 PostThreadMessage(id_, WM_QUIT, 0, 0); | 154 PostThreadMessage(id_, WM_QUIT, 0, 0); |
155 } | 155 } |
156 private: | 156 private: |
157 Win32SocketServer ss_; | 157 Win32SocketServer ss_; |
158 DWORD id_; | 158 DWORD id_; |
159 }; | 159 }; |
160 | 160 |
161 /////////////////////////////////////////////////////////////////////////////// | 161 /////////////////////////////////////////////////////////////////////////////// |
162 | 162 |
163 } // namespace rtc | 163 } // namespace rtc |
164 | 164 |
165 #endif // WEBRTC_WIN | 165 #endif // WEBRTC_WIN |
166 | 166 |
167 #endif // WEBRTC_BASE_WIN32SOCKETSERVER_H_ | 167 #endif // WEBRTC_BASE_WIN32SOCKETSERVER_H_ |
OLD | NEW |