Bug 1540136 - P2: CDMProxy stores main thread as nsISerialEventTarget, rather than nsIEventTarget. r=cpearce

This gives us greater flexibility in using the main thread member to run
promises.

The site where we obtain the main thread returns a serial event target, so we're
not doing much more work here, we're just keeping the serial event target
interface, rather than converting to an event target interface.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Bryce Van Dyk 2019-04-09 15:06:38 +00:00
Родитель 1def9c5ba7
Коммит 8fa2904e50
7 изменённых файлов: 9 добавлений и 8 удалений

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

@ -82,7 +82,7 @@ class CDMProxy {
// Main thread only.
CDMProxy(dom::MediaKeys* aKeys, const nsAString& aKeySystem,
bool aDistinctiveIdentifierRequired, bool aPersistentStateRequired,
nsIEventTarget* aMainThread)
nsISerialEventTarget* aMainThread)
: mKeys(aKeys),
mKeySystem(aKeySystem),
mCapabilites("CDMProxy::mCDMCaps"),
@ -272,7 +272,7 @@ class CDMProxy {
const bool mPersistentStateRequired;
// The main thread associated with the root document.
const nsCOMPtr<nsIEventTarget> mMainThread;
const nsCOMPtr<nsISerialEventTarget> mMainThread;
};
} // namespace mozilla

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

@ -372,7 +372,7 @@ class MediaKeysGMPCrashHelper : public GMPCrashHelper {
};
already_AddRefed<CDMProxy> MediaKeys::CreateCDMProxy(
nsIEventTarget* aMainThread) {
nsISerialEventTarget* aMainThread) {
EME_LOG("MediaKeys[%p]::CreateCDMProxy()", this);
RefPtr<CDMProxy> proxy;
#ifdef MOZ_WIDGET_ANDROID

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

@ -155,7 +155,7 @@ class MediaKeys final : public nsIDocumentActivity,
// Instantiate CDMProxy instance.
// It could be MediaDrmCDMProxy (Widevine on Fennec) or ChromiumCDMProxy (the
// rest).
already_AddRefed<CDMProxy> CreateCDMProxy(nsIEventTarget* aMainThread);
already_AddRefed<CDMProxy> CreateCDMProxy(nsISerialEventTarget* aMainThread);
// Removes promise from mPromises, and returns it.
already_AddRefed<DetailedPromise> RetrievePromise(PromiseId aId);

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

@ -28,7 +28,7 @@ MediaDrmCDMProxy::MediaDrmCDMProxy(dom::MediaKeys* aKeys,
const nsAString& aKeySystem,
bool aDistinctiveIdentifierRequired,
bool aPersistentStateRequired,
nsIEventTarget* aMainThread)
nsISerialEventTarget* aMainThread)
: CDMProxy(aKeys, aKeySystem, aDistinctiveIdentifierRequired,
aPersistentStateRequired, aMainThread),
mCDM(nullptr),

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

@ -31,7 +31,8 @@ class MediaDrmCDMProxy : public CDMProxy {
MediaDrmCDMProxy(dom::MediaKeys* aKeys, const nsAString& aKeySystem,
bool aDistinctiveIdentifierRequired,
bool aPersistentStateRequired, nsIEventTarget* aMainThread);
bool aPersistentStateRequired,
nsISerialEventTarget* aMainThread);
void Init(PromiseId aPromiseId, const nsAString& aOrigin,
const nsAString& aTopLevelOrigin,

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

@ -22,7 +22,7 @@ ChromiumCDMProxy::ChromiumCDMProxy(dom::MediaKeys* aKeys,
GMPCrashHelper* aCrashHelper,
bool aDistinctiveIdentifierRequired,
bool aPersistentStateRequired,
nsIEventTarget* aMainThread)
nsISerialEventTarget* aMainThread)
: CDMProxy(aKeys, aKeySystem, aDistinctiveIdentifierRequired,
aPersistentStateRequired, aMainThread),
mCrashHelper(aCrashHelper),

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

@ -23,7 +23,7 @@ class ChromiumCDMProxy : public CDMProxy {
ChromiumCDMProxy(dom::MediaKeys* aKeys, const nsAString& aKeySystem,
GMPCrashHelper* aCrashHelper,
bool aAllowDistinctiveIdentifier, bool aAllowPersistentState,
nsIEventTarget* aMainThread);
nsISerialEventTarget* aMainThread);
void Init(PromiseId aPromiseId, const nsAString& aOrigin,
const nsAString& aTopLevelOrigin,