зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1311848 - Don't call ConnectPendingPromiseIdWithToken in MediaKeySession::Load. r=kikuo
We don't need to call MediaKeys::ConnectPendingPromiseIdWithToken() on the MediaKeySession::Load() path, we already know the session Id, and we've already removed the session from the list of pending sessions in Load(). MozReview-Commit-ID: KBiEsY95Csi --HG-- extra : rebase_source : aadc3204409df35e4bbcb9532c530f860681afd1
This commit is contained in:
Родитель
22b1ca7b53
Коммит
ea73ebebc8
|
@ -405,7 +405,6 @@ MediaKeySession::Load(const nsAString& aSessionId, ErrorResult& aRv)
|
|||
SetSessionId(aSessionId);
|
||||
|
||||
PromiseId pid = mKeys->StorePromise(promise);
|
||||
mKeys->ConnectPendingPromiseIdWithToken(pid, Token());
|
||||
mKeys->GetCDMProxy()->LoadSession(pid, aSessionId);
|
||||
|
||||
EME_LOG("MediaKeySession[%p,'%s'] Load() sent to CDM, promiseId=%d",
|
||||
|
|
|
@ -199,8 +199,7 @@ MediaKeys::StorePromise(DetailedPromise* aPromise)
|
|||
void
|
||||
MediaKeys::ConnectPendingPromiseIdWithToken(PromiseId aId, uint32_t aToken)
|
||||
{
|
||||
// Should only be called from MediaKeySession::GenerateRequest and
|
||||
// MediaKeySession::Load.
|
||||
// Should only be called from MediaKeySession::GenerateRequest.
|
||||
mPromiseIdToken.Put(aId, aToken);
|
||||
EME_LOG("MediaKeys[%p]::ConnectPendingPromiseIdWithToken() id=%u => token(%u)",
|
||||
this, aId, aToken);
|
||||
|
|
|
@ -108,9 +108,11 @@ public:
|
|||
// promises to be resolved.
|
||||
PromiseId StorePromise(DetailedPromise* aPromise);
|
||||
|
||||
// Stores a map for promise id and session token, and it will be used to
|
||||
// remove the pending sessions by promise id while creating/loading various
|
||||
// sessions in the same time.
|
||||
// Stores a map from promise id to pending session token. Using this
|
||||
// mapping, when a promise is rejected via its ID, we can check if the
|
||||
// promise corresponds to a pending session and retrieve that session
|
||||
// via the mapped-to token, and remove the pending session from the
|
||||
// list of sessions awaiting a session id.
|
||||
void ConnectPendingPromiseIdWithToken(PromiseId aId, uint32_t aToken);
|
||||
|
||||
// Reject promise with DOMException corresponding to aExceptionCode.
|
||||
|
|
Загрузка…
Ссылка в новой задаче