OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 SharedXDisplay::~SharedXDisplay() { | 27 SharedXDisplay::~SharedXDisplay() { |
28 RTC_DCHECK(event_handlers_.empty()); | 28 RTC_DCHECK(event_handlers_.empty()); |
29 XCloseDisplay(display_); | 29 XCloseDisplay(display_); |
30 } | 30 } |
31 | 31 |
32 // static | 32 // static |
33 rtc::scoped_refptr<SharedXDisplay> SharedXDisplay::Create( | 33 rtc::scoped_refptr<SharedXDisplay> SharedXDisplay::Create( |
34 const std::string& display_name) { | 34 const std::string& display_name) { |
35 Display* display = | 35 Display* display = |
36 XOpenDisplay(display_name.empty() ? NULL : display_name.c_str()); | 36 XOpenDisplay(display_name.empty() ? nullptr : display_name.c_str()); |
37 if (!display) { | 37 if (!display) { |
38 LOG(LS_ERROR) << "Unable to open display"; | 38 LOG(LS_ERROR) << "Unable to open display"; |
39 return NULL; | 39 return nullptr; |
40 } | 40 } |
41 return new SharedXDisplay(display); | 41 return new SharedXDisplay(display); |
42 } | 42 } |
43 | 43 |
44 // static | 44 // static |
45 rtc::scoped_refptr<SharedXDisplay> SharedXDisplay::CreateDefault() { | 45 rtc::scoped_refptr<SharedXDisplay> SharedXDisplay::CreateDefault() { |
46 return Create(std::string()); | 46 return Create(std::string()); |
47 } | 47 } |
48 | 48 |
49 void SharedXDisplay::AddEventHandler(int type, XEventHandler* handler) { | 49 void SharedXDisplay::AddEventHandler(int type, XEventHandler* handler) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 continue; | 81 continue; |
82 for (std::vector<XEventHandler*>::iterator it = handlers->second.begin(); | 82 for (std::vector<XEventHandler*>::iterator it = handlers->second.begin(); |
83 it != handlers->second.end(); ++it) { | 83 it != handlers->second.end(); ++it) { |
84 if ((*it)->HandleXEvent(e)) | 84 if ((*it)->HandleXEvent(e)) |
85 break; | 85 break; |
86 } | 86 } |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 } // namespace webrtc | 90 } // namespace webrtc |
OLD | NEW |