1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/system/gonk/VolumeServiceIOThread.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef mozilla_system_volumeserviceiothread_h__ 1.9 +#define mozilla_system_volumeserviceiothread_h__ 1.10 + 1.11 +#include "Volume.h" 1.12 +#include "VolumeManager.h" 1.13 +#include "mozilla/RefPtr.h" 1.14 + 1.15 +namespace mozilla { 1.16 +namespace system { 1.17 + 1.18 +class nsVolumeService; 1.19 + 1.20 +/*************************************************************************** 1.21 +* The nsVolumeServiceIOThread is a companion class to the nsVolumeService 1.22 +* class, but whose methods are called from IOThread. 1.23 +*/ 1.24 +class VolumeServiceIOThread : public VolumeManager::StateObserver, 1.25 + public Volume::EventObserver 1.26 +{ 1.27 + ~VolumeServiceIOThread(); 1.28 + 1.29 +public: 1.30 + NS_INLINE_DECL_REFCOUNTING(VolumeServiceIOThread) 1.31 + 1.32 + VolumeServiceIOThread(nsVolumeService* aVolumeService); 1.33 + 1.34 +private: 1.35 + void UpdateAllVolumes(); 1.36 + 1.37 + virtual void Notify(const VolumeManager::StateChangedEvent& aEvent); 1.38 + virtual void Notify(Volume* const & aVolume); 1.39 + 1.40 + RefPtr<nsVolumeService> mVolumeService; 1.41 +}; 1.42 + 1.43 +void InitVolumeServiceIOThread(nsVolumeService* const & aVolumeService); 1.44 +void ShutdownVolumeServiceIOThread(); 1.45 +void FormatVolume(const nsCString& aVolume); 1.46 +void MountVolume(const nsCString& aVolume); 1.47 +void UnmountVolume(const nsCString& aVolume); 1.48 + 1.49 +} // system 1.50 +} // mozilla 1.51 + 1.52 +#endif // mozilla_system_volumeserviceiothread_h__