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
parent 5a8983aed0
commit a96b2f3536
2 changed files with 23 additions and 3 deletions

View File

@ -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

View File

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