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

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

Issue 890213002: Add basic support for CAPS exe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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_(NULL) {
scottmg 2015/02/01 19:55:35 NULL -> nullptr
12 auto mutex = ::CreateMutexW(nullptr, TRUE, L"CHROME.CAPS.V1");
scottmg 2015/02/01 19:55:35 no W (are we not building as _UNICODE properly? if
cpu_(ooo_6.6-7.5) 2015/02/03 02:44:58 afaik we build ok, old habits die hard. changed.
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

Powered by Google App Engine
This is Rietveld 408576698