Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(800)

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp

Issue 2407013002: EME: Improve promise lifetime (Closed)
Patch Set: more checks Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp
index 6794efc865aace4962dd7f4e0536caef6bac8a94..872c7c8758d26865fa3b2c52e7a90e75bee6f296 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp
@@ -46,6 +46,10 @@ class NewCdmResultPromise : public ContentDecryptionModuleResultPromise {
void completeWithContentDecryptionModule(
WebContentDecryptionModule* cdm) override {
// NOTE: Continued from step 2.8 of createMediaKeys().
+
+ if (!isValidToFulfillPromise())
+ return;
+
// 2.9. Let media keys be a new MediaKeys object.
MediaKeys* mediaKeys = MediaKeys::create(
getExecutionContext(), m_supportedSessionTypes, wrapUnique(cdm));

Powered by Google App Engine
This is Rietveld 408576698