示例#1
0
void
nsVolume::LogState() const
{
  if (mState == nsIVolume::STATE_MOUNTED) {
    LOG("nsVolume: %s state %s @ '%s' gen %d locked %d fake %d "
        "media %d sharing %d formatting %d unmounting %d",
        NameStr().get(), StateStr(), MountPointStr().get(),
        MountGeneration(), (int)IsMountLocked(), (int)IsFake(),
        (int)IsMediaPresent(), (int)IsSharing(),
        (int)IsFormatting(), (int)IsUnmounting());
    return;
  }

  LOG("nsVolume: %s state %s", NameStr().get(), StateStr());
}
示例#2
0
void
nsVolume::SetState(int32_t aState)
{
  static int32_t sMountGeneration = 0;

  MOZ_ASSERT(XRE_IsParentProcess());
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(IsFake());

  if (aState == mState) {
    return;
  }

  if (aState == nsIVolume::STATE_MOUNTED) {
    mMountGeneration = ++sMountGeneration;
  }

  mState = aState;
}