Chromium Code Reviews| Index: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| index 40d3e7fa1d64910517529b7aa182df489d8c7f13..619bafd94c44c8fd0b7e37560c7bf24b2321e19f 100644 |
| --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| @@ -843,15 +843,30 @@ void MediaKeySession::message(MessageType messageType, |
| void MediaKeySession::close() { |
|
ddorwin
2016/10/11 01:41:07
This method is overloaded with the implementation
jrummell
2016/10/11 18:47:35
Since we're switching blink to Chromium style, we
|
| DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; |
| - // From https://w3c.github.io/encrypted-media/#session-close: |
| - // The following steps are run: |
| - // 1. Let the session be the associated MediaKeySession object. |
| - // 2. Let promise be the closed attribute of the session. |
| - // 3. Resolve promise. |
| + // From http://w3c.github.io/encrypted-media/#session-closed |
| + // 1. Let session be the associated MediaKeySession object. |
| + // 2. If session's session type is "persistent-usage-record", execute the |
| + // following steps in parallel: |
| + // 1. Let cdm be the CDM instance represented by session's cdm instance |
| + // value. |
| + // 2. Use cdm to store session's record of key usage, if it exists. |
| + // ("persistent-usage-record" not supported by Chrome.) |
| + |
| + // 3. Run the Update Key Statuses algorithm on the session, providing an |
| + // empty sequence. |
| + keysStatusesChange(WebVector<WebEncryptedMediaKeyInformation>(), false); |
| + |
| + // 4. Run the Update Expiration algorithm on the session, providing NaN. |
| + expirationChanged(std::numeric_limits<double>::quiet_NaN()); |
|
ddorwin
2016/10/11 01:41:07
Unrelated to this CL, it's odd that we have Change
jrummell
2016/10/11 18:47:35
Agreed.
|
| + |
| + // 5. Let promise be the closed attribute of the session. |
| + // 6. Resolve promise. |
| m_closedPromise->resolve(ToV8UndefinedGenerator()); |
| - // Once closed, the session can no longer be the target of events from |
| - // the CDM so this object can be garbage collected. |
| + // After this algorithm has run, event handlers for the events queued by |
| + // this algorithm will be executed, but no further events can be queued. |
| + // As a result, no messages can be sent by the CDM as a result of closing |
| + // the session. |
| m_isClosed = true; |
| } |