Chromium Code Reviews| Index: Source/modules/encryptedmedia/MediaKeys.cpp |
| diff --git a/Source/modules/encryptedmedia/MediaKeys.cpp b/Source/modules/encryptedmedia/MediaKeys.cpp |
| index 285c58ac43759816a82d9feee78e1ae6a207b0e1..5daedaeadb64c378fa8570938640f619f688e7d0 100644 |
| --- a/Source/modules/encryptedmedia/MediaKeys.cpp |
| +++ b/Source/modules/encryptedmedia/MediaKeys.cpp |
| @@ -78,10 +78,11 @@ MediaKeys::MediaKeys(const String& keySystem, PassOwnPtr<ContentDecryptionModule |
| MediaKeys::~MediaKeys() |
| { |
| + // FIXME: This reference is outdated. |
|
acolwell GONE FROM CHROMIUM
2014/01/06 20:18:37
nit: any reason not to update the reference in thi
xhwang
2014/01/09 01:04:41
This is removed now.
|
| // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#dom-media-keys-constructor>: |
| - // When destroying a MediaKeys object, follow the steps in close(). |
| + // When destroying a MediaKeys object, follow the steps in release(). |
| for (size_t i = 0; i < m_sessions.size(); ++i) |
| - m_sessions[i]->close(); |
| + m_sessions[i]->release(); |
| } |
| PassRefPtr<MediaKeySession> MediaKeys::createSession(ExecutionContext* context, const String& type, Uint8Array* initData, ExceptionState& exceptionState) |
| @@ -90,35 +91,34 @@ PassRefPtr<MediaKeySession> MediaKeys::createSession(ExecutionContext* context, |
| // The createSession(type, initData) method must run the following steps: |
| // Note: The contents of initData are container-specific Initialization Data. |
| - // 1. If type is null or an empty string and initData is not null or an empty string, throw an |
| + // If type is null or an empty string and initData is not null or an empty string, throw an |
|
acolwell GONE FROM CHROMIUM
2014/01/06 20:18:37
nit: Why is this no longer a step in the spec? Thi
xhwang
2014/01/09 01:04:41
Added FIXME.
ddorwin
2014/01/25 01:49:36
This is now steps in the spec: https://dvcs.w3.org
|
| // InvalidAccessError exception and abort these steps. |
| if ((type.isEmpty()) && (!initData || initData->length())) { |
| exceptionState.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| return 0; |
| } |
| - // 2. If type contains a MIME type that is not supported or is not supported by the keySystem, throw |
| - // a NotSupportedError exception and abort these steps. |
| + // 1. If type contains a MIME type that is not supported or is not supported by the keySystem, |
| + // throw a NOT_SUPPORTED_ERR exception and abort these steps. |
| ASSERT(!type.isEmpty()); |
| if (type.isEmpty() || !m_cdm->supportsMIMEType(type)) { |
| exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError); |
| return 0; |
| } |
| - // 3. Create a new MediaKeySession object. |
| + // 2. Create a new MediaKeySession object. |
| RefPtr<MediaKeySession> session = MediaKeySession::create(context, m_cdm.get(), this); |
| - // 3.1 Let the keySystem attribute be keySystem. |
| + // 2.1 Let the keySystem attribute be keySystem. |
| ASSERT(!session->keySystem().isEmpty()); |
| - // 3.2 Let the sessionId attribute be a unique Session ID string. It may be generated by cdm. |
| - // This is handled by m_cdm and may happen asynchronously. |
| + // FIXME: 2.2 Let the state of the session be CREATED. |
| - // 4. Add the new object to an internal list of session objects. |
| + // 3. Add the new object to an internal list of session objects. |
| m_sessions.append(session); |
| - // 5. Schedule a task to generate a key request, providing type, initData, and the new object. |
| - session->generateKeyRequest(type, initData); |
| + // 4. Schedule a task to initialize the session, providing type, initData, and the new object. |
| + session->initialize(type, initData); |
|
xhwang
2014/01/04 01:07:53
The name "initialize" comes from the spec: "Schedu
|
| - // 6. Return the new object to the caller. |
| + // 5. Return the new object to the caller. |
| return session; |
| } |