OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 // A libjingle compatible SocketServer for OSX/iOS/Cocoa. | |
12 | |
13 #ifndef WEBRTC_BASE_MACCOCOASOCKETSERVER_H_ | |
14 #define WEBRTC_BASE_MACCOCOASOCKETSERVER_H_ | |
15 | |
16 #include "webrtc/base/constructormagic.h" | |
17 #include "webrtc/base/macsocketserver.h" | |
18 | |
19 #ifdef __OBJC__ | |
20 @class NSTimer, MacCocoaSocketServerHelperRtc; | |
21 #else | |
22 class NSTimer; | |
23 class MacCocoaSocketServerHelperRtc; | |
24 #endif | |
25 | |
26 namespace rtc { | |
27 | |
28 // A socketserver implementation that wraps the main cocoa | |
29 // application loop accessed through [NSApp run]. | |
30 class MacCocoaSocketServer : public MacBaseSocketServer { | |
31 public: | |
32 explicit MacCocoaSocketServer(); | |
33 ~MacCocoaSocketServer() override; | |
34 | |
35 bool Wait(int cms, bool process_io) override; | |
36 void WakeUp() override; | |
37 | |
38 private: | |
39 MacCocoaSocketServerHelperRtc* helper_; | |
40 NSTimer* timer_; // Weak. | |
41 // The count of how many times we're inside the NSApplication main loop. | |
42 int run_count_; | |
43 | |
44 RTC_DISALLOW_COPY_AND_ASSIGN(MacCocoaSocketServer); | |
45 }; | |
46 | |
47 } // namespace rtc | |
48 | |
49 #endif // WEBRTC_BASE_MACCOCOASOCKETSERVER_H_ | |
OLD | NEW |