зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1112989 - Part 3. Remove sync PContent::GetVolumes() r=dhylands
This commit is contained in:
Родитель
a845477766
Коммит
b8fbfbe8d9
|
@ -2699,19 +2699,6 @@ ContentParent::RecvDataStoreGetStores(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
ContentParent::RecvGetVolumes(InfallibleTArray<VolumeInfo>* aResult)
|
|
||||||
{
|
|
||||||
#ifdef MOZ_WIDGET_GONK
|
|
||||||
nsRefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
|
|
||||||
vs->GetVolumesForIPC(aResult);
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
NS_WARNING("ContentParent::RecvGetVolumes shouldn't be called when MOZ_WIDGET_GONK is not defined");
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ContentParent::RecvNuwaReady()
|
ContentParent::RecvNuwaReady()
|
||||||
{
|
{
|
||||||
|
|
|
@ -700,7 +700,6 @@ private:
|
||||||
virtual bool RecvAudioChannelChangeDefVolChannel(const int32_t& aChannel,
|
virtual bool RecvAudioChannelChangeDefVolChannel(const int32_t& aChannel,
|
||||||
const bool& aHidden) MOZ_OVERRIDE;
|
const bool& aHidden) MOZ_OVERRIDE;
|
||||||
virtual bool RecvGetSystemMemory(const uint64_t& getterId) MOZ_OVERRIDE;
|
virtual bool RecvGetSystemMemory(const uint64_t& getterId) MOZ_OVERRIDE;
|
||||||
virtual bool RecvGetVolumes(InfallibleTArray<VolumeInfo>* aResult) MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
virtual bool RecvDataStoreGetStores(
|
virtual bool RecvDataStoreGetStores(
|
||||||
const nsString& aName,
|
const nsString& aName,
|
||||||
|
|
|
@ -766,8 +766,6 @@ parent:
|
||||||
nsString aFilepath,
|
nsString aFilepath,
|
||||||
nsCString aReason);
|
nsCString aReason);
|
||||||
|
|
||||||
sync GetVolumes() returns (VolumeInfo[] volumes);
|
|
||||||
|
|
||||||
// Notify the parent that the child has finished handling a system message.
|
// Notify the parent that the child has finished handling a system message.
|
||||||
async SystemMessageHandled();
|
async SystemMessageHandled();
|
||||||
|
|
||||||
|
|
|
@ -126,8 +126,6 @@ nsVolumeService::Callback(const nsAString& aTopic, const nsAString& aState)
|
||||||
|
|
||||||
NS_IMETHODIMP nsVolumeService::GetVolumeByName(const nsAString& aVolName, nsIVolume **aResult)
|
NS_IMETHODIMP nsVolumeService::GetVolumeByName(const nsAString& aVolName, nsIVolume **aResult)
|
||||||
{
|
{
|
||||||
GetVolumesFromParent();
|
|
||||||
|
|
||||||
MonitorAutoLock autoLock(mArrayMonitor);
|
MonitorAutoLock autoLock(mArrayMonitor);
|
||||||
|
|
||||||
nsRefPtr<nsVolume> vol = FindVolumeByName(aVolName);
|
nsRefPtr<nsVolume> vol = FindVolumeByName(aVolName);
|
||||||
|
@ -142,8 +140,6 @@ NS_IMETHODIMP nsVolumeService::GetVolumeByName(const nsAString& aVolName, nsIVol
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsVolumeService::GetVolumeByPath(const nsAString& aPath, nsIVolume **aResult)
|
nsVolumeService::GetVolumeByPath(const nsAString& aPath, nsIVolume **aResult)
|
||||||
{
|
{
|
||||||
GetVolumesFromParent();
|
|
||||||
|
|
||||||
NS_ConvertUTF16toUTF8 utf8Path(aPath);
|
NS_ConvertUTF16toUTF8 utf8Path(aPath);
|
||||||
char realPathBuf[PATH_MAX];
|
char realPathBuf[PATH_MAX];
|
||||||
|
|
||||||
|
@ -194,8 +190,6 @@ nsVolumeService::GetVolumeByPath(const nsAString& aPath, nsIVolume **aResult)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsVolumeService::CreateOrGetVolumeByPath(const nsAString& aPath, nsIVolume** aResult)
|
nsVolumeService::CreateOrGetVolumeByPath(const nsAString& aPath, nsIVolume** aResult)
|
||||||
{
|
{
|
||||||
GetVolumesFromParent();
|
|
||||||
|
|
||||||
nsresult rv = GetVolumeByPath(aPath, aResult);
|
nsresult rv = GetVolumeByPath(aPath, aResult);
|
||||||
if (rv == NS_OK) {
|
if (rv == NS_OK) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -220,8 +214,6 @@ nsVolumeService::CreateOrGetVolumeByPath(const nsAString& aPath, nsIVolume** aRe
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsVolumeService::GetVolumeNames(nsIArray** aVolNames)
|
nsVolumeService::GetVolumeNames(nsIArray** aVolNames)
|
||||||
{
|
{
|
||||||
GetVolumesFromParent();
|
|
||||||
|
|
||||||
NS_ENSURE_ARG_POINTER(aVolNames);
|
NS_ENSURE_ARG_POINTER(aVolNames);
|
||||||
MonitorAutoLock autoLock(mArrayMonitor);
|
MonitorAutoLock autoLock(mArrayMonitor);
|
||||||
|
|
||||||
|
@ -307,25 +299,6 @@ nsVolumeService::RecvVolumesFromParent(const nsTArray<VolumeInfo>& aVolumes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsVolumeService::GetVolumesFromParent()
|
|
||||||
{
|
|
||||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
|
||||||
// We are the parent. Therefore our volumes are already correct.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mGotVolumesFromParent) {
|
|
||||||
// We've already done this, no need to do it again.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsTArray<VolumeInfo> result;
|
|
||||||
ContentChild::GetSingleton()->SendGetVolumes(&result);
|
|
||||||
RecvVolumesFromParent(result);
|
|
||||||
|
|
||||||
mGotVolumesFromParent = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsVolumeService::CreateMountLock(const nsAString& aVolumeName, nsIVolumeMountLock **aResult)
|
nsVolumeService::CreateMountLock(const nsAString& aVolumeName, nsIVolumeMountLock **aResult)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,6 @@ private:
|
||||||
already_AddRefed<nsVolume> FindVolumeByMountLockName(const nsAString& aMountLockName);
|
already_AddRefed<nsVolume> FindVolumeByMountLockName(const nsAString& aMountLockName);
|
||||||
already_AddRefed<nsVolume> FindVolumeByName(const nsAString& aName);
|
already_AddRefed<nsVolume> FindVolumeByName(const nsAString& aName);
|
||||||
already_AddRefed<nsVolume> CreateOrFindVolumeByName(const nsAString& aName, bool aIsFake = false);
|
already_AddRefed<nsVolume> CreateOrFindVolumeByName(const nsAString& aName, bool aIsFake = false);
|
||||||
void GetVolumesFromParent();
|
|
||||||
|
|
||||||
Monitor mArrayMonitor;
|
Monitor mArrayMonitor;
|
||||||
nsVolume::Array mVolumeArray;
|
nsVolume::Array mVolumeArray;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче