gecko/dom/system/gonk/nsVolumeMountLock.h
Dave Hylands e9207164c6 Bug 785124 - Pt 1 - Add VolumeMountLock which allows SDCard to be locked. r=dougt
From 8e39b8e5f3ab7e6344b0a8a5eeabdcf672de8fb4 Mon Sep 17 00:00:00 2001
---
 dom/ipc/ContentChild.cpp                  |   18 +++-
 dom/ipc/ContentChild.h                    |    5 +-
 dom/ipc/ContentParent.cpp                 |   22 +++-
 dom/ipc/ContentParent.h                   |    2 +
 dom/ipc/PContent.ipdl                     |    6 +-
 dom/system/gonk/AutoMounter.cpp           |   19 +++-
 dom/system/gonk/Makefile.in               |    4 +-
 dom/system/gonk/Volume.cpp                |   62 ++++++++++-
 dom/system/gonk/Volume.h                  |   11 +-
 dom/system/gonk/VolumeServiceIOThread.cpp |   11 +-
 dom/system/gonk/VolumeServiceIOThread.h   |    7 +-
 dom/system/gonk/nsIVolume.idl             |   21 +++-
 dom/system/gonk/nsIVolumeMountLock.idl    |   12 +++
 dom/system/gonk/nsIVolumeService.idl      |    9 +-
 dom/system/gonk/nsVolume.cpp              |   96 ++++++++++++++++-
 dom/system/gonk/nsVolume.h                |   43 ++++++--
 dom/system/gonk/nsVolumeMountLock.cpp     |  157 +++++++++++++++++++++++++++
 dom/system/gonk/nsVolumeMountLock.h       |   55 ++++++++++
 dom/system/gonk/nsVolumeService.cpp       |  168 +++++++++++++++++++++++------
 dom/system/gonk/nsVolumeService.h         |   20 +++-
 layout/build/nsLayoutModule.cpp           |    5 +-
 layout/build/nsLayoutStatics.cpp          |    9 ++
 22 files changed, 684 insertions(+), 78 deletions(-)
 create mode 100644 dom/system/gonk/nsIVolumeMountLock.idl
 create mode 100644 dom/system/gonk/nsVolumeMountLock.cpp
 create mode 100644 dom/system/gonk/nsVolumeMountLock.h
2012-12-14 16:01:34 -08:00

54 lines
1.5 KiB
C++

/* 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_nsvolumemountlock_h__
#define mozilla_system_nsvolumemountlock_h__
#include "nsIVolumeMountLock.h"
#include "nsIDOMWakeLock.h"
#include "nsIObserver.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsWeakReference.h"
namespace mozilla {
namespace system {
/* The VolumeMountLock is designed so that it can be used in the Child or
* Parent process. While the VolumeMountLock object exists, then the
* VolumeManager/AutoMounter will prevent a mounted volume from being
* shared with the PC.
*/
class nsVolumeMountLock MOZ_FINAL : public nsIVolumeMountLock,
public nsIObserver,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DECL_NSIVOLUMEMOUNTLOCK
static already_AddRefed<nsVolumeMountLock> Create(const nsAString &volumeName);
const nsString &VolumeName() const { return mVolumeName; }
private:
nsVolumeMountLock(const nsAString &aVolumeName);
~nsVolumeMountLock();
nsresult Init();
nsString mVolumeName;
int32_t mVolumeGeneration;
nsCOMPtr<nsIDOMMozWakeLock> mWakeLock;
bool mUnlocked;
};
} // namespace system
} // namespace mozilla
#endif // mozilla_system_nsvolumemountlock_h__