Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_system_nsvolumemountlock_h__
6 #define mozilla_system_nsvolumemountlock_h__
8 #include "nsIVolumeMountLock.h"
10 #include "mozilla/dom/WakeLock.h"
11 #include "nsIObserver.h"
12 #include "nsString.h"
13 #include "nsTArray.h"
14 #include "nsAutoPtr.h"
15 #include "nsWeakReference.h"
17 namespace mozilla {
18 namespace system {
20 /* The VolumeMountLock is designed so that it can be used in the Child or
21 * Parent process. While the VolumeMountLock object exists, then the
22 * VolumeManager/AutoMounter will prevent a mounted volume from being
23 * shared with the PC.
24 */
26 class nsVolumeMountLock MOZ_FINAL : public nsIVolumeMountLock,
27 public nsIObserver,
28 public nsSupportsWeakReference
29 {
30 public:
31 NS_DECL_ISUPPORTS
32 NS_DECL_NSIOBSERVER
33 NS_DECL_NSIVOLUMEMOUNTLOCK
35 static already_AddRefed<nsVolumeMountLock> Create(const nsAString& volumeName);
37 const nsString& VolumeName() const { return mVolumeName; }
39 private:
40 nsVolumeMountLock(const nsAString& aVolumeName);
41 ~nsVolumeMountLock();
43 nsresult Init();
45 nsRefPtr<dom::WakeLock> mWakeLock;
46 nsString mVolumeName;
47 int32_t mVolumeGeneration;
48 bool mUnlocked;
49 };
51 } // namespace system
52 } // namespace mozilla
54 #endif // mozilla_system_nsvolumemountlock_h__