Bug 1143562. Part2 - only init |mStorageBaseDir| in the chrome process. r=cpearce

This commit is contained in:
JW Wang 2015-03-18 19:15:00 +01:00
Родитель 80b1b90328
Коммит 88d592058a
2 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -191,6 +191,27 @@ GeckoMediaPluginService::Init()
prefs->AddObserver("media.gmp.plugin.crash", this, false);
}
nsresult rv = InitStorage();
if (NS_FAILED(rv)) {
return rv;
}
// Kick off scanning for plugins
nsCOMPtr<nsIThread> thread;
return GetThread(getter_AddRefs(thread));
}
nsresult
GeckoMediaPluginService::InitStorage()
{
MOZ_ASSERT(NS_IsMainThread());
// GMP storage should be used in the chrome process only.
if (XRE_GetProcessType() != GeckoProcessType_Default) {
return NS_OK;
}
// Directory service is main thread only, so cache the profile dir here
// so that we can use it off main thread.
#ifdef MOZ_WIDGET_GONK
@ -213,9 +234,7 @@ GeckoMediaPluginService::Init()
return rv;
}
// Kick off scanning for plugins
nsCOMPtr<nsIThread> thread;
return GetThread(getter_AddRefs(thread));
return NS_OK;
}
NS_IMETHODIMP

Просмотреть файл

@ -91,6 +91,7 @@ protected:
private:
GMPParent* ClonePlugin(const GMPParent* aOriginal);
nsresult EnsurePluginsOnDiskScanned();
nsresult InitStorage();
class PathRunnable : public nsRunnable
{