|
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/. */ |
|
4 |
|
5 #ifndef mozilla_system_volumeserviceiothread_h__ |
|
6 #define mozilla_system_volumeserviceiothread_h__ |
|
7 |
|
8 #include "Volume.h" |
|
9 #include "VolumeManager.h" |
|
10 #include "mozilla/RefPtr.h" |
|
11 |
|
12 namespace mozilla { |
|
13 namespace system { |
|
14 |
|
15 class nsVolumeService; |
|
16 |
|
17 /*************************************************************************** |
|
18 * The nsVolumeServiceIOThread is a companion class to the nsVolumeService |
|
19 * class, but whose methods are called from IOThread. |
|
20 */ |
|
21 class VolumeServiceIOThread : public VolumeManager::StateObserver, |
|
22 public Volume::EventObserver |
|
23 { |
|
24 ~VolumeServiceIOThread(); |
|
25 |
|
26 public: |
|
27 NS_INLINE_DECL_REFCOUNTING(VolumeServiceIOThread) |
|
28 |
|
29 VolumeServiceIOThread(nsVolumeService* aVolumeService); |
|
30 |
|
31 private: |
|
32 void UpdateAllVolumes(); |
|
33 |
|
34 virtual void Notify(const VolumeManager::StateChangedEvent& aEvent); |
|
35 virtual void Notify(Volume* const & aVolume); |
|
36 |
|
37 RefPtr<nsVolumeService> mVolumeService; |
|
38 }; |
|
39 |
|
40 void InitVolumeServiceIOThread(nsVolumeService* const & aVolumeService); |
|
41 void ShutdownVolumeServiceIOThread(); |
|
42 void FormatVolume(const nsCString& aVolume); |
|
43 void MountVolume(const nsCString& aVolume); |
|
44 void UnmountVolume(const nsCString& aVolume); |
|
45 |
|
46 } // system |
|
47 } // mozilla |
|
48 |
|
49 #endif // mozilla_system_volumeserviceiothread_h__ |