зеркало из https://github.com/mozilla/gecko-dev.git
Bug 835408 - nsVolume NameStr and MountPointStr noe return nsCString rather than ptr to freed memory. r=jlebar
This commit is contained in:
Родитель
c3979e5b53
Коммит
e69de7d4fa
|
@ -101,12 +101,12 @@ nsVolume::LogState() const
|
|||
{
|
||||
if (mState == nsIVolume::STATE_MOUNTED) {
|
||||
LOG("nsVolume: %s state %s @ '%s' gen %d locked %d",
|
||||
NameStr(), StateStr(), MountPointStr(),
|
||||
NameStr().get(), StateStr(), MountPointStr().get(),
|
||||
MountGeneration(), (int)IsMountLocked());
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("nsVolume: %s state %s", NameStr(), StateStr());
|
||||
LOG("nsVolume: %s state %s", NameStr().get(), StateStr());
|
||||
}
|
||||
|
||||
void nsVolume::Set(const nsVolume* aVolume)
|
||||
|
|
|
@ -60,13 +60,13 @@ public:
|
|||
void LogState() const;
|
||||
|
||||
const nsString& Name() const { return mName; }
|
||||
const char* NameStr() const { return NS_LossyConvertUTF16toASCII(mName).get(); }
|
||||
nsCString NameStr() const { return NS_LossyConvertUTF16toASCII(mName); }
|
||||
|
||||
int32_t MountGeneration() const { return mMountGeneration; }
|
||||
bool IsMountLocked() const { return mMountLocked; }
|
||||
|
||||
const nsString& MountPoint() const { return mMountPoint; }
|
||||
const char* MountPointStr() const { return NS_LossyConvertUTF16toASCII(mMountPoint).get(); }
|
||||
nsCString MountPointStr() const { return NS_LossyConvertUTF16toASCII(mMountPoint); }
|
||||
|
||||
int32_t State() const { return mState; }
|
||||
const char* StateStr() const { return NS_VolumeStateStr(mState); }
|
||||
|
|
|
@ -129,7 +129,7 @@ NS_IMETHODIMP nsVolumeService::BroadcastVolume(const nsAString& aVolName)
|
|||
nsCOMPtr<nsIObserverService> obs = GetObserverService();
|
||||
NS_ENSURE_TRUE(obs, NS_NOINTERFACE);
|
||||
|
||||
DBG("nsVolumeService::BroadcastVolume for '%s'", vol->NameStr());
|
||||
DBG("nsVolumeService::BroadcastVolume for '%s'", vol->NameStr().get());
|
||||
nsString stateStr(NS_ConvertUTF8toUTF16(vol->StateStr()));
|
||||
obs->NotifyObservers(vol, NS_VOLUME_STATE_CHANGED, stateStr.get());
|
||||
return NS_OK;
|
||||
|
@ -291,8 +291,8 @@ public:
|
|||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
DBG("UpdateVolumeRunnable::Run '%s' state %s gen %d locked %d",
|
||||
mVolume->NameStr(), mVolume->StateStr(), mVolume->MountGeneration(),
|
||||
(int)mVolume->IsMountLocked());
|
||||
mVolume->NameStr().get(), mVolume->StateStr(),
|
||||
mVolume->MountGeneration(), (int)mVolume->IsMountLocked());
|
||||
|
||||
mVolumeService->UpdateVolume(mVolume);
|
||||
mVolumeService = NULL;
|
||||
|
|
Загрузка…
Ссылка в новой задаче