michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_system_volumeserviceiothread_h__ michael@0: #define mozilla_system_volumeserviceiothread_h__ michael@0: michael@0: #include "Volume.h" michael@0: #include "VolumeManager.h" michael@0: #include "mozilla/RefPtr.h" michael@0: michael@0: namespace mozilla { michael@0: namespace system { michael@0: michael@0: class nsVolumeService; michael@0: michael@0: /*************************************************************************** michael@0: * The nsVolumeServiceIOThread is a companion class to the nsVolumeService michael@0: * class, but whose methods are called from IOThread. michael@0: */ michael@0: class VolumeServiceIOThread : public VolumeManager::StateObserver, michael@0: public Volume::EventObserver michael@0: { michael@0: ~VolumeServiceIOThread(); michael@0: michael@0: public: michael@0: NS_INLINE_DECL_REFCOUNTING(VolumeServiceIOThread) michael@0: michael@0: VolumeServiceIOThread(nsVolumeService* aVolumeService); michael@0: michael@0: private: michael@0: void UpdateAllVolumes(); michael@0: michael@0: virtual void Notify(const VolumeManager::StateChangedEvent& aEvent); michael@0: virtual void Notify(Volume* const & aVolume); michael@0: michael@0: RefPtr mVolumeService; michael@0: }; michael@0: michael@0: void InitVolumeServiceIOThread(nsVolumeService* const & aVolumeService); michael@0: void ShutdownVolumeServiceIOThread(); michael@0: void FormatVolume(const nsCString& aVolume); michael@0: void MountVolume(const nsCString& aVolume); michael@0: void UnmountVolume(const nsCString& aVolume); michael@0: michael@0: } // system michael@0: } // mozilla michael@0: michael@0: #endif // mozilla_system_volumeserviceiothread_h__