| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // 3. Use cdm to generate a key request and follow the steps for the fir
st matching condition from the following list: | 106 // 3. Use cdm to generate a key request and follow the steps for the fir
st matching condition from the following list: |
| 107 m_session->generateKeyRequest(request.mimeType, *request.initData); | 107 m_session->generateKeyRequest(request.mimeType, *request.initData); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 void MediaKeySession::update(Uint8Array* key, ExceptionCode& ec) | 111 void MediaKeySession::update(Uint8Array* key, ExceptionCode& ec) |
| 112 { | 112 { |
| 113 // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/e
ncrypted-media.html#dom-addkey>: | 113 // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/e
ncrypted-media.html#dom-addkey>: |
| 114 // The addKey(key) method must run the following steps: | 114 // The addKey(key) method must run the following steps: |
| 115 // 1. If the first or second argument [sic] is null or an empty array, throw
an INVALID_ACCESS_ERR. | 115 // 1. If the first or second argument [sic] is null or an empty array, throw
an InvalidAccessError. |
| 116 // NOTE: the reference to a "second argument" is a spec bug. | 116 // NOTE: the reference to a "second argument" is a spec bug. |
| 117 if (!key || !key->length()) { | 117 if (!key || !key->length()) { |
| 118 ec = INVALID_ACCESS_ERR; | 118 ec = InvalidAccessError; |
| 119 return; | 119 return; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // 2. Schedule a task to handle the call, providing key. | 122 // 2. Schedule a task to handle the call, providing key. |
| 123 m_pendingKeys.append(key); | 123 m_pendingKeys.append(key); |
| 124 m_addKeyTimer.startOneShot(0); | 124 m_addKeyTimer.startOneShot(0); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void MediaKeySession::addKeyTimerFired(Timer<MediaKeySession>*) | 127 void MediaKeySession::addKeyTimerFired(Timer<MediaKeySession>*) |
| 128 { | 128 { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 { | 195 { |
| 196 return eventNames().interfaceForMediaKeySession; | 196 return eventNames().interfaceForMediaKeySession; |
| 197 } | 197 } |
| 198 | 198 |
| 199 ScriptExecutionContext* MediaKeySession::scriptExecutionContext() const | 199 ScriptExecutionContext* MediaKeySession::scriptExecutionContext() const |
| 200 { | 200 { |
| 201 return ContextLifecycleObserver::scriptExecutionContext(); | 201 return ContextLifecycleObserver::scriptExecutionContext(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } | 204 } |
| OLD | NEW |