mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1112989 - Part 3. Remove sync PContent::GetVolumes() r=dhylands
This commit is contained in:
parent
a845477766
commit
b8fbfbe8d9
@ -2699,19 +2699,6 @@ ContentParent::RecvDataStoreGetStores(
|
||||
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
|
||||
ContentParent::RecvNuwaReady()
|
||||
{
|
||||
|
@ -700,7 +700,6 @@ private:
|
||||
virtual bool RecvAudioChannelChangeDefVolChannel(const int32_t& aChannel,
|
||||
const bool& aHidden) MOZ_OVERRIDE;
|
||||
virtual bool RecvGetSystemMemory(const uint64_t& getterId) MOZ_OVERRIDE;
|
||||
virtual bool RecvGetVolumes(InfallibleTArray<VolumeInfo>* aResult) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvDataStoreGetStores(
|
||||
const nsString& aName,
|
||||
|
@ -766,8 +766,6 @@ parent:
|
||||
nsString aFilepath,
|
||||
nsCString aReason);
|
||||
|
||||
sync GetVolumes() returns (VolumeInfo[] volumes);
|
||||
|
||||
// Notify the parent that the child has finished handling a system message.
|
||||
async SystemMessageHandled();
|
||||
|
||||
|
@ -126,8 +126,6 @@ nsVolumeService::Callback(const nsAString& aTopic, const nsAString& aState)
|
||||
|
||||
NS_IMETHODIMP nsVolumeService::GetVolumeByName(const nsAString& aVolName, nsIVolume **aResult)
|
||||
{
|
||||
GetVolumesFromParent();
|
||||
|
||||
MonitorAutoLock autoLock(mArrayMonitor);
|
||||
|
||||
nsRefPtr<nsVolume> vol = FindVolumeByName(aVolName);
|
||||
@ -142,8 +140,6 @@ NS_IMETHODIMP nsVolumeService::GetVolumeByName(const nsAString& aVolName, nsIVol
|
||||
NS_IMETHODIMP
|
||||
nsVolumeService::GetVolumeByPath(const nsAString& aPath, nsIVolume **aResult)
|
||||
{
|
||||
GetVolumesFromParent();
|
||||
|
||||
NS_ConvertUTF16toUTF8 utf8Path(aPath);
|
||||
char realPathBuf[PATH_MAX];
|
||||
|
||||
@ -194,8 +190,6 @@ nsVolumeService::GetVolumeByPath(const nsAString& aPath, nsIVolume **aResult)
|
||||
NS_IMETHODIMP
|
||||
nsVolumeService::CreateOrGetVolumeByPath(const nsAString& aPath, nsIVolume** aResult)
|
||||
{
|
||||
GetVolumesFromParent();
|
||||
|
||||
nsresult rv = GetVolumeByPath(aPath, aResult);
|
||||
if (rv == NS_OK) {
|
||||
return NS_OK;
|
||||
@ -220,8 +214,6 @@ nsVolumeService::CreateOrGetVolumeByPath(const nsAString& aPath, nsIVolume** aRe
|
||||
NS_IMETHODIMP
|
||||
nsVolumeService::GetVolumeNames(nsIArray** aVolNames)
|
||||
{
|
||||
GetVolumesFromParent();
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aVolNames);
|
||||
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
|
||||
nsVolumeService::CreateMountLock(const nsAString& aVolumeName, nsIVolumeMountLock **aResult)
|
||||
{
|
||||
|
@ -59,7 +59,6 @@ private:
|
||||
already_AddRefed<nsVolume> FindVolumeByMountLockName(const nsAString& aMountLockName);
|
||||
already_AddRefed<nsVolume> FindVolumeByName(const nsAString& aName);
|
||||
already_AddRefed<nsVolume> CreateOrFindVolumeByName(const nsAString& aName, bool aIsFake = false);
|
||||
void GetVolumesFromParent();
|
||||
|
||||
Monitor mArrayMonitor;
|
||||
nsVolume::Array mVolumeArray;
|
||||
|
Loading…
Reference in New Issue
Block a user