Bug 1867190 - Add prefs for PHC probablities r=glandium
[gecko.git] / toolkit / mozapps / defaultagent / WindowsMutex.h
blob5e8b32314c15963ed00cec8dac409fbe7c4fc968
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef __DEFAULT_BROWSER_AGENT_DEFAULT_AGENT_MUTEX_H__
8 #define __DEFAULT_BROWSER_AGENT_DEFAULT_AGENT_MUTEX_H__
10 #include "nsString.h"
11 #include "nsWindowsHelpers.h"
13 #include "nsIWindowsMutex.h"
15 namespace mozilla::default_agent {
17 class WindowsMutexFactory final : public nsIWindowsMutexFactory {
18 public:
19 NS_DECL_ISUPPORTS
20 NS_DECL_NSIWINDOWSMUTEXFACTORY
22 WindowsMutexFactory() = default;
24 private:
25 ~WindowsMutexFactory() = default;
28 class WindowsMutex final : public nsIWindowsMutex {
29 public:
30 NS_DECL_ISUPPORTS
31 NS_DECL_NSIWINDOWSMUTEX
33 WindowsMutex(const nsString& aName, nsAutoHandle& aMutex);
35 private:
36 nsAutoHandle mMutex;
37 nsCString mName;
38 bool mLocked;
40 ~WindowsMutex();
43 } // namespace mozilla::default_agent
45 #endif // __DEFAULT_BROWSER_AGENT_DEFAULT_AGENT_MUTEX_H__