2012-07-16 20:38:18 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_system_volumeserviceiothread_h__
|
|
|
|
#define mozilla_system_volumeserviceiothread_h__
|
|
|
|
|
|
|
|
#include "Volume.h"
|
|
|
|
#include "VolumeManager.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2012-07-16 20:38:18 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace system {
|
|
|
|
|
2012-12-15 04:01:34 +04:00
|
|
|
class nsVolumeService;
|
|
|
|
|
2012-07-16 20:38:18 +04:00
|
|
|
/***************************************************************************
|
|
|
|
* The nsVolumeServiceIOThread is a companion class to the nsVolumeService
|
|
|
|
* class, but whose methods are called from IOThread.
|
|
|
|
*/
|
|
|
|
class VolumeServiceIOThread : public VolumeManager::StateObserver,
|
2014-04-14 23:04:24 +04:00
|
|
|
public Volume::EventObserver
|
2012-07-16 20:38:18 +04:00
|
|
|
{
|
2014-04-14 23:04:24 +04:00
|
|
|
~VolumeServiceIOThread();
|
|
|
|
|
2012-07-16 20:38:18 +04:00
|
|
|
public:
|
2014-04-14 23:04:24 +04:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(VolumeServiceIOThread)
|
|
|
|
|
2013-01-07 20:43:02 +04:00
|
|
|
VolumeServiceIOThread(nsVolumeService* aVolumeService);
|
2012-07-16 20:38:18 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
void UpdateAllVolumes();
|
|
|
|
|
2013-01-07 20:43:02 +04:00
|
|
|
virtual void Notify(const VolumeManager::StateChangedEvent& aEvent);
|
|
|
|
virtual void Notify(Volume* const & aVolume);
|
2012-07-16 20:38:18 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsVolumeService> mVolumeService;
|
2012-07-16 20:38:18 +04:00
|
|
|
};
|
|
|
|
|
2013-01-07 20:43:02 +04:00
|
|
|
void InitVolumeServiceIOThread(nsVolumeService* const & aVolumeService);
|
2012-07-16 20:38:18 +04:00
|
|
|
void ShutdownVolumeServiceIOThread();
|
2013-09-06 10:11:58 +04:00
|
|
|
void FormatVolume(const nsCString& aVolume);
|
2014-03-04 15:24:19 +04:00
|
|
|
void MountVolume(const nsCString& aVolume);
|
|
|
|
void UnmountVolume(const nsCString& aVolume);
|
2012-07-16 20:38:18 +04:00
|
|
|
|
|
|
|
} // system
|
|
|
|
} // mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_system_volumeserviceiothread_h__
|