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

Side by Side Diff: chrome/tools/crash_service/caps/process_singleton_win.cc

Issue 1858883004: Remove CAPS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp Created 4 years, 7 months 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <windows.h>
6
7 #include "chrome/tools/crash_service/caps/process_singleton_win.h"
8
9 namespace caps {
10
11 ProcessSingleton::ProcessSingleton() : mutex_(nullptr) {
12 auto mutex = ::CreateMutex(nullptr, TRUE, L"CHROME.CAPS.V1");
13 if (!mutex)
14 return;
15 if (::GetLastError() == ERROR_ALREADY_EXISTS) {
16 ::CloseHandle(mutex);
17 return;
18 }
19 // We are now the single instance.
20 mutex_ = mutex;
21 }
22
23 ProcessSingleton::~ProcessSingleton() {
24 if (mutex_)
25 ::CloseHandle(mutex_);
26 }
27
28 } // namespace caps
29
OLDNEW
« no previous file with comments | « chrome/tools/crash_service/caps/process_singleton_win.h ('k') | chrome/tools/crash_service/crash_service.exe.manifest » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698