OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_LINUX_X11_UTIL_H_ | 5 #ifndef REMOTING_HOST_LINUX_X11_UTIL_H_ |
6 #define REMOTING_HOST_LINUX_X11_UTIL_H_ | 6 #define REMOTING_HOST_LINUX_X11_UTIL_H_ |
7 | 7 |
8 // Xlib.h defines XErrorEvent as an anonymous struct, so we can't forward- | 8 // Xlib.h defines XErrorEvent as an anonymous struct, so we can't forward- |
9 // declare it in this header. Since Xlib.h is not generally something you | 9 // declare it in this header. Since Xlib.h is not generally something you |
10 // should #include into arbitrary code, please refrain from #including this | 10 // should #include into arbitrary code, please refrain from #including this |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bool ok_; | 42 bool ok_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(ScopedXErrorHandler); | 44 DISALLOW_COPY_AND_ASSIGN(ScopedXErrorHandler); |
45 }; | 45 }; |
46 | 46 |
47 | 47 |
48 // Grab/release the X server within a scope. This can help avoid race | 48 // Grab/release the X server within a scope. This can help avoid race |
49 // conditions that would otherwise lead to X errors. | 49 // conditions that would otherwise lead to X errors. |
50 class ScopedXGrabServer { | 50 class ScopedXGrabServer { |
51 public: | 51 public: |
52 ScopedXGrabServer(Display* display); | 52 explicit ScopedXGrabServer(Display* display); |
53 ~ScopedXGrabServer(); | 53 ~ScopedXGrabServer(); |
54 | 54 |
55 private: | 55 private: |
56 Display* display_; | 56 Display* display_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(ScopedXGrabServer); | 58 DISALLOW_COPY_AND_ASSIGN(ScopedXGrabServer); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace remoting | 61 } // namespace remoting |
62 | 62 |
63 #endif // REMOTING_HOST_LINUX_X11_UTIL_H_ | 63 #endif // REMOTING_HOST_LINUX_X11_UTIL_H_ |
OLD | NEW |