mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1112989 - Part 2. Forward device-storage volumes info to ContentChild before app startup. r=dhylands
This commit is contained in:
parent
1043dea8b9
commit
0c55d69367
@ -2136,6 +2136,18 @@ ContentChild::RecvLastPrivateDocShellDestroyed()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvVolumes(nsTArray<VolumeInfo>&& aVolumes)
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
nsRefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
|
||||
if (vs) {
|
||||
vs->RecvVolumesFromParent(aVolumes);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvFilePathUpdate(const nsString& aStorageType,
|
||||
const nsString& aStorageName,
|
||||
|
@ -332,6 +332,7 @@ public:
|
||||
|
||||
virtual bool RecvLastPrivateDocShellDestroyed() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvVolumes(InfallibleTArray<VolumeInfo>&& aVolumes) MOZ_OVERRIDE;
|
||||
virtual bool RecvFilePathUpdate(const nsString& aStorageType,
|
||||
const nsString& aStorageName,
|
||||
const nsString& aPath,
|
||||
|
@ -1319,6 +1319,14 @@ ContentParent::ForwardKnownInfo()
|
||||
if (!mMetamorphosed) {
|
||||
return;
|
||||
}
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
InfallibleTArray<VolumeInfo> volumeInfo;
|
||||
nsRefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
|
||||
if (vs) {
|
||||
vs->GetVolumesForIPC(&volumeInfo);
|
||||
unused << SendVolumes(volumeInfo);
|
||||
}
|
||||
#endif /* MOZ_WIDGET_GONK */
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -471,6 +471,8 @@ child:
|
||||
|
||||
ScreenSizeChanged(gfxIntSize size);
|
||||
|
||||
Volumes(VolumeInfo[] volumes);
|
||||
|
||||
FlushMemory(nsString reason);
|
||||
|
||||
GarbageCollect();
|
||||
|
@ -280,7 +280,7 @@ nsVolumeService::GetVolumesForIPC(nsTArray<VolumeInfo>* aResult)
|
||||
}
|
||||
|
||||
void
|
||||
nsVolumeService::GetVolumesFromParent()
|
||||
nsVolumeService::RecvVolumesFromParent(const nsTArray<VolumeInfo>& aVolumes)
|
||||
{
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||
// We are the parent. Therefore our volumes are already correct.
|
||||
@ -290,12 +290,8 @@ nsVolumeService::GetVolumesFromParent()
|
||||
// We've already done this, no need to do it again.
|
||||
return;
|
||||
}
|
||||
mGotVolumesFromParent = true;
|
||||
|
||||
nsTArray<VolumeInfo> result;
|
||||
ContentChild::GetSingleton()->SendGetVolumes(&result);
|
||||
for (uint32_t i = 0; i < result.Length(); i++) {
|
||||
const VolumeInfo& volInfo(result[i]);
|
||||
for (uint32_t i = 0; i < aVolumes.Length(); i++) {
|
||||
const VolumeInfo& volInfo(aVolumes[i]);
|
||||
nsRefPtr<nsVolume> vol = new nsVolume(volInfo.name(),
|
||||
volInfo.mountPoint(),
|
||||
volInfo.volState(),
|
||||
@ -311,6 +307,25 @@ nsVolumeService::GetVolumesFromParent()
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -48,6 +48,7 @@ public:
|
||||
void UpdateVolume(nsIVolume* aVolume, bool aNotifyObservers = true);
|
||||
void UpdateVolumeIOThread(const Volume* aVolume);
|
||||
|
||||
void RecvVolumesFromParent(const nsTArray<dom::VolumeInfo>& aVolumes);
|
||||
void GetVolumesForIPC(nsTArray<dom::VolumeInfo>* aResult);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user