Bug 1312540 - Simplify behaviour of GMP::GetPluginVersionForAPI. r=gerald
We only have one version of a GMP installed at once anyway. This version code
is to support Adobe Primetime, and that's disabled.
Making the behaviour of this code simpler will make it easier to have the
same behaviour of the GetGMPVersion code in e10s and non-e10s mode.
I will be removing this code soon, but I will do that in a later patch, so as
to not complicate the uplift.
MozReview-Commit-ID: 3cn7GhihWzm
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -975,29 +975,22 @@ GeckoMediaPluginServiceParent::GetPlugin
NS_WARNING("Failed to load GMPs from disk.");
return rv;
}
{
MutexAutoLock lock(mMutex);
nsCString api(aAPI);
size_t index = 0;
-
- // We must parse the version number into a float for comparison. Yuck.
- double maxParsedVersion = -1.;
-
- *aHasPlugin = false;
- while (RefPtr<GMPParent> gmp = FindPluginForAPIFrom(index, api, *aTags, &index)) {
+ RefPtr<GMPParent> gmp = FindPluginForAPIFrom(index, api, *aTags, &index);
+ if (gmp) {
*aHasPlugin = true;
- double parsedVersion = atof(gmp->GetVersion().get());
- if (maxParsedVersion < 0 || parsedVersion > maxParsedVersion) {
- maxParsedVersion = parsedVersion;
- aOutVersion = gmp->GetVersion();
- }
- index++;
+ aOutVersion = gmp->GetVersion();
+ } else {
+ *aHasPlugin = false;
}
}
return NS_OK;
}
nsresult
GeckoMediaPluginServiceParent::EnsurePluginsOnDiskScanned()