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

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

Issue 2583093002: Reduce SuspendableObjects (Closed)
Patch Set: Created 4 years 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/MediaKeys.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
index 7cbe44ca71580679b2b4bb36d9195442b1157f82..a4229079730a06002a2b0cfb2a42c1f83101442c 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
@@ -129,17 +129,14 @@ MediaKeys* MediaKeys::create(
ExecutionContext* context,
const WebVector<WebEncryptedMediaSessionType>& supportedSessionTypes,
std::unique_ptr<WebContentDecryptionModule> cdm) {
- MediaKeys* mediaKeys =
- new MediaKeys(context, supportedSessionTypes, std::move(cdm));
- mediaKeys->suspendIfNeeded();
- return mediaKeys;
+ return new MediaKeys(context, supportedSessionTypes, std::move(cdm));
}
MediaKeys::MediaKeys(
ExecutionContext* context,
const WebVector<WebEncryptedMediaSessionType>& supportedSessionTypes,
std::unique_ptr<WebContentDecryptionModule> cdm)
- : SuspendableObject(context),
+ : ContextLifecycleObserver(context),
m_supportedSessionTypes(supportedSessionTypes),
m_cdm(std::move(cdm)),
m_mediaElement(nullptr),
@@ -292,7 +289,7 @@ WebContentDecryptionModule* MediaKeys::contentDecryptionModule() {
DEFINE_TRACE(MediaKeys) {
visitor->trace(m_pendingActions);
visitor->trace(m_mediaElement);
- SuspendableObject::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
}
void MediaKeys::contextDestroyed() {
@@ -300,7 +297,7 @@ void MediaKeys::contextDestroyed() {
m_pendingActions.clear();
// We don't need the CDM anymore. Only destroyed after all related
- // SuspendableObjects have been stopped.
+ // ContextLifecycleObservers have been stopped.
m_cdm.reset();
}

Powered by Google App Engine
This is Rietveld 408576698