Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: webrtc/modules/desktop_capture/screen_drawer_win.cc

Issue 2444583002: Move ScreenCapturer 'real' tests out of screen_capturer_unittest.cc. (Closed)
Patch Set: Resolve review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/desktop_capture/screen_drawer_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include <windows.h> 11 #include <windows.h>
12 12
13 #include <memory> 13 #include <memory>
14 14
15 #include "webrtc/modules/desktop_capture/screen_drawer.h" 15 #include "webrtc/modules/desktop_capture/screen_drawer.h"
16 #include "webrtc/system_wrappers/include/sleep.h" 16 #include "webrtc/system_wrappers/include/sleep.h"
17 17
18 namespace webrtc { 18 namespace webrtc {
19 19
20 namespace { 20 namespace {
21 21
22 static constexpr TCHAR kMutexName[] = 22 static constexpr TCHAR kMutexName[] =
23 TEXT("Local\\ScreenDrawerWin-da834f82-8044-11e6-ac81-73dcdd1c1869"); 23 TEXT("Local\\ScreenDrawerWin-da834f82-8044-11e6-ac81-73dcdd1c1869");
24 24
25 class ScreenDrawerLockWin : public ScreenDrawerLock { 25 class ScreenDrawerLockWin : public ScreenDrawerLock {
26 public: 26 public:
27 ScreenDrawerLockWin(); 27 ScreenDrawerLockWin();
28 ~ScreenDrawerLockWin(); 28 ~ScreenDrawerLockWin() override;
29 29
30 private: 30 private:
31 HANDLE mutex_; 31 HANDLE mutex_;
32 }; 32 };
33 33
34 ScreenDrawerLockWin::ScreenDrawerLockWin() { 34 ScreenDrawerLockWin::ScreenDrawerLockWin() {
35 while (true) { 35 while (true) {
36 mutex_ = CreateMutex(NULL, FALSE, kMutexName); 36 mutex_ = CreateMutex(NULL, FALSE, kMutexName);
37 if (GetLastError() != ERROR_ALREADY_EXISTS && mutex_ != NULL) { 37 if (GetLastError() != ERROR_ALREADY_EXISTS && mutex_ != NULL) {
38 break; 38 break;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 std::unique_ptr<ScreenDrawerLock> ScreenDrawerLock::Create() { 194 std::unique_ptr<ScreenDrawerLock> ScreenDrawerLock::Create() {
195 return std::unique_ptr<ScreenDrawerLock>(new ScreenDrawerLockWin()); 195 return std::unique_ptr<ScreenDrawerLock>(new ScreenDrawerLockWin());
196 } 196 }
197 197
198 // static 198 // static
199 std::unique_ptr<ScreenDrawer> ScreenDrawer::Create() { 199 std::unique_ptr<ScreenDrawer> ScreenDrawer::Create() {
200 return std::unique_ptr<ScreenDrawer>(new ScreenDrawerWin()); 200 return std::unique_ptr<ScreenDrawer>(new ScreenDrawerWin());
201 } 201 }
202 202
203 } // namespace webrtc 203 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/screen_drawer_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698