Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / tools / crash_service / caps / process_singleton_win.h
blob5440d9c0fb3903d0b4e9d64ee5e86524d7ed8f98
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.
5 #ifndef CHROME_TOOLS_CRASH_SERVICE_CAPS_PROCESS_SINGLETON_WIN_H_
6 #define CHROME_TOOLS_CRASH_SERVICE_CAPS_PROCESS_SINGLETON_WIN_H_
8 #include <windows.h>
10 #include "base/macros.h"
12 namespace caps {
13 // Uses a named mutex to make sure that only one process of
14 // with this particular version is launched.
15 class ProcessSingleton {
16 public:
17 ProcessSingleton();
18 ~ProcessSingleton();
19 bool other_instance() const { return mutex_ == NULL; }
21 private:
22 HANDLE mutex_;
24 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton);
27 } // namespace caps
29 #endif // CHROME_TOOLS_CRASH_SERVICE_CAPS_PROCESS_SINGLETON_WIN_H_