зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1288976 - Use gmp-changed rather than gmp-path-added to retry MediaKeys requests. r=gerald
We're already routing the "gmp-changed" observer service notification over from the chrome process to the content process, and it fires at pretty much the same time as the "gmp-path-added" notification (and a few more) so we can just switch to have the MediaKeySystemAccessManager listen on that notification instead, and we'll be e10s compatible. MozReview-Commit-ID: EowFDfdWgAJ --HG-- extra : rebase_source : ad01990278cf9005f6676ef0b7fa0acbf69249eb
This commit is contained in:
Родитель
464384943c
Коммит
d183d8433b
|
@ -1683,6 +1683,9 @@ bool
|
|||
ContentChild::RecvNotifyGMPsChanged()
|
||||
{
|
||||
GMPDecoderModule::UpdateUsableCodecs();
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
obs->NotifyObservers(nullptr, "gmp-changed", nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -263,7 +263,7 @@ MediaKeySystemAccessManager::Observe(nsISupports* aSubject,
|
|||
{
|
||||
EME_LOG("MediaKeySystemAccessManager::Observe %s", aTopic);
|
||||
|
||||
if (!strcmp(aTopic, "gmp-path-added")) {
|
||||
if (!strcmp(aTopic, "gmp-changed")) {
|
||||
nsTArray<PendingRequest> requests(Move(mRequests));
|
||||
// Retry all pending requests, but this time fail if the CDM is not installed.
|
||||
for (PendingRequest& request : requests) {
|
||||
|
@ -296,7 +296,7 @@ MediaKeySystemAccessManager::EnsureObserversAdded()
|
|||
if (NS_WARN_IF(!obsService)) {
|
||||
return false;
|
||||
}
|
||||
mAddedObservers = NS_SUCCEEDED(obsService->AddObserver(this, "gmp-path-added", false));
|
||||
mAddedObservers = NS_SUCCEEDED(obsService->AddObserver(this, "gmp-changed", false));
|
||||
return mAddedObservers;
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ MediaKeySystemAccessManager::Shutdown()
|
|||
if (mAddedObservers) {
|
||||
nsCOMPtr<nsIObserverService> obsService = mozilla::services::GetObserverService();
|
||||
if (obsService) {
|
||||
obsService->RemoveObserver(this, "gmp-path-added");
|
||||
obsService->RemoveObserver(this, "gmp-changed");
|
||||
mAddedObservers = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1107,7 +1107,6 @@ GeckoMediaPluginServiceParent::AddOnGMPThread(nsString aDirectory)
|
|||
MutexAutoLock lock(self->mMutex);
|
||||
self->mPlugins.AppendElement(gmp);
|
||||
}
|
||||
NS_DispatchToMainThread(new NotifyObserversTask("gmp-path-added"), NS_DISPATCH_NORMAL);
|
||||
},
|
||||
[dir]() -> void {
|
||||
LOGD(("%s::%s: %s Failed", __CLASS__, __FUNCTION__, dir.get()));
|
||||
|
|
Загрузка…
Ссылка в новой задаче