mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 20:17:37 +00:00
62aeb83227
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
64 lines
2.2 KiB
Plaintext
64 lines
2.2 KiB
Plaintext
/* 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/. */
|
|
|
|
#include "nsISupports.idl"
|
|
#include "nsIVolumeStat.idl"
|
|
|
|
[scriptable, uuid(1134f267-7b81-42f2-b64a-6edb91286576)]
|
|
interface nsIVolume : nsISupports
|
|
{
|
|
// These MUST match the states from android's system/vold/Volume.h header
|
|
const long STATE_INIT = -1;
|
|
const long STATE_NOMEDIA = 0;
|
|
const long STATE_IDLE = 1;
|
|
const long STATE_PENDING = 2;
|
|
const long STATE_CHECKING = 3;
|
|
const long STATE_MOUNTED = 4;
|
|
const long STATE_UNMOUNTING = 5;
|
|
const long STATE_FORMATTING = 6;
|
|
const long STATE_SHARED = 7;
|
|
const long STATE_SHAREDMNT = 8;
|
|
|
|
// The name of the volume. Often there is only one volume, called sdcard.
|
|
// But some phones support multiple volumes.
|
|
readonly attribute DOMString name;
|
|
|
|
// The mount point is the path on the system where the volume is mounted
|
|
// and is only valid when state == STATE_MOUNTED.
|
|
readonly attribute DOMString mountPoint;
|
|
|
|
// Reflects the current state of the volume, using STATE_xxx constants
|
|
// from above.
|
|
readonly attribute long state;
|
|
|
|
// mountGeneration is a unique number which is used distinguish between
|
|
// periods of time that a volume is in the mounted state. Each time a
|
|
// volume transitions to the mounted state, the mountGeneration will
|
|
// be different from the last time it transitioned to the mounted state.
|
|
readonly attribute long mountGeneration;
|
|
|
|
// While a volume is mounted, it can be locked, preventing it from being
|
|
// shared with the PC. To lock a volume, acquire an nsIDOMMozWakeLock
|
|
// using the name of this attribute. Note that mountLockName changes
|
|
// every time the mountGeneration changes, so you'll need to reacquire
|
|
// the wakelock every time the volume becomes mounted.
|
|
readonly attribute DOMString mountLockName;
|
|
|
|
nsIVolumeStat getStats();
|
|
};
|
|
|
|
%{C++
|
|
// For use with the ObserverService
|
|
#define NS_VOLUME_STATE_CHANGED "volume-state-changed"
|
|
|
|
namespace mozilla {
|
|
namespace system {
|
|
|
|
// Convert a state into a loggable/printable string.
|
|
const char *NS_VolumeStateStr(int32_t aState);
|
|
|
|
} // system
|
|
} // mozilla
|
|
%}
|