Bug 1592797 - Fix MediaKeys linker error exposed with different optimization flags r=edgar

Seeing this linker error when building with optimization flags -O2 and others:
.../mozilla-central/dom/media/eme/mediadrm/MediaDrmCDMProxy.cpp:297: error: undefined reference to 'void mozilla::dom::MediaKeys::ResolvePromiseWithResult<bool>(unsigned int, bool const&)'

This patch moves the template definition from dom/media/eme/MediaKeys.cpp to dom/media/eme/MediaKeys.h

Differential Revision: https://phabricator.services.mozilla.com/D51188

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Creskey 2019-11-14 14:06:12 +00:00
parent ffec9b2750
commit 603b880e70
2 changed files with 7 additions and 11 deletions

View File

@ -569,16 +569,6 @@ void MediaKeys::OnSessionLoaded(PromiseId aId, bool aSuccess) {
ResolvePromiseWithResult(aId, aSuccess);
}
template <typename T>
void MediaKeys::ResolvePromiseWithResult(PromiseId aId, const T& aResult) {
RefPtr<DetailedPromise> promise(RetrievePromise(aId));
if (!promise) {
return;
}
promise->MaybeResolve(aResult);
}
void MediaKeys::OnSessionClosed(MediaKeySession* aSession) {
nsAutoString id;
aSession->GetSessionId(id);

View File

@ -149,7 +149,13 @@ class MediaKeys final : public nsIDocumentActivity,
dom::MediaKeyStatus aMediaKeyStatus);
template <typename T>
void ResolvePromiseWithResult(PromiseId aId, const T& aResult);
void ResolvePromiseWithResult(PromiseId aId, const T& aResult) {
RefPtr<DetailedPromise> promise(RetrievePromise(aId));
if (!promise) {
return;
}
promise->MaybeResolve(aResult);
}
private:
// Instantiate CDMProxy instance.