Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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_volumeserviceiothread_h__
6 #define mozilla_system_volumeserviceiothread_h__
8 #include "Volume.h"
9 #include "VolumeManager.h"
10 #include "mozilla/RefPtr.h"
12 namespace mozilla {
13 namespace system {
15 class nsVolumeService;
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();
26 public:
27 NS_INLINE_DECL_REFCOUNTING(VolumeServiceIOThread)
29 VolumeServiceIOThread(nsVolumeService* aVolumeService);
31 private:
32 void UpdateAllVolumes();
34 virtual void Notify(const VolumeManager::StateChangedEvent& aEvent);
35 virtual void Notify(Volume* const & aVolume);
37 RefPtr<nsVolumeService> mVolumeService;
38 };
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);
46 } // system
47 } // mozilla
49 #endif // mozilla_system_volumeserviceiothread_h__