| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 12 matching lines...) Expand all Loading... |
| 23 namespace webrtc { | 23 namespace webrtc { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 static constexpr char kSemaphoreName[] = | 27 static constexpr char kSemaphoreName[] = |
| 28 "/global-screen-drawer-linux-54fe5552-8047-11e6-a725-3f429a5b4fb4"; | 28 "/global-screen-drawer-linux-54fe5552-8047-11e6-a725-3f429a5b4fb4"; |
| 29 | 29 |
| 30 class ScreenDrawerLockLinux : public ScreenDrawerLock { | 30 class ScreenDrawerLockLinux : public ScreenDrawerLock { |
| 31 public: | 31 public: |
| 32 ScreenDrawerLockLinux(); | 32 ScreenDrawerLockLinux(); |
| 33 ~ScreenDrawerLockLinux(); | 33 ~ScreenDrawerLockLinux() override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 sem_t* semaphore_; | 36 sem_t* semaphore_; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 ScreenDrawerLockLinux::ScreenDrawerLockLinux() { | 39 ScreenDrawerLockLinux::ScreenDrawerLockLinux() { |
| 40 semaphore_ = | 40 semaphore_ = |
| 41 sem_open(kSemaphoreName, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1); | 41 sem_open(kSemaphoreName, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1); |
| 42 sem_wait(semaphore_); | 42 sem_wait(semaphore_); |
| 43 } | 43 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 // static | 192 // static |
| 193 std::unique_ptr<ScreenDrawer> ScreenDrawer::Create() { | 193 std::unique_ptr<ScreenDrawer> ScreenDrawer::Create() { |
| 194 if (SharedXDisplay::CreateDefault().get()) { | 194 if (SharedXDisplay::CreateDefault().get()) { |
| 195 return std::unique_ptr<ScreenDrawer>(new ScreenDrawerLinux()); | 195 return std::unique_ptr<ScreenDrawer>(new ScreenDrawerLinux()); |
| 196 } | 196 } |
| 197 return nullptr; | 197 return nullptr; |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace webrtc | 200 } // namespace webrtc |
| OLD | NEW |