| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // The user agent will asynchronously execute the following steps in the
task: | 103 // The user agent will asynchronously execute the following steps in the
task: |
| 104 | 104 |
| 105 // 1. Let cdm be the cdm loaded in the MediaKeys constructor. | 105 // 1. Let cdm be the cdm loaded in the MediaKeys constructor. |
| 106 // 2. Let destinationURL be null. | 106 // 2. Let destinationURL be null. |
| 107 | 107 |
| 108 // 3. Use cdm to generate a key request and follow the steps for the fir
st matching condition from the following list: | 108 // 3. Use cdm to generate a key request and follow the steps for the fir
st matching condition from the following list: |
| 109 m_session->generateKeyRequest(request.mimeType, *request.initData); | 109 m_session->generateKeyRequest(request.mimeType, *request.initData); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 void MediaKeySession::update(Uint8Array* key, ExceptionState& es) | 113 void MediaKeySession::update(Uint8Array* key, ExceptionState& exceptionState) |
| 114 { | 114 { |
| 115 // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/e
ncrypted-media.html#dom-addkey>: | 115 // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/e
ncrypted-media.html#dom-addkey>: |
| 116 // The addKey(key) method must run the following steps: | 116 // The addKey(key) method must run the following steps: |
| 117 // 1. If the first or second argument [sic] is null or an empty array, throw
an InvalidAccessError. | 117 // 1. If the first or second argument [sic] is null or an empty array, throw
an InvalidAccessError. |
| 118 // NOTE: the reference to a "second argument" is a spec bug. | 118 // NOTE: the reference to a "second argument" is a spec bug. |
| 119 if (!key || !key->length()) { | 119 if (!key || !key->length()) { |
| 120 es.throwUninformativeAndGenericDOMException(InvalidAccessError); | 120 exceptionState.throwUninformativeAndGenericDOMException(InvalidAccessErr
or); |
| 121 return; | 121 return; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // 2. Schedule a task to handle the call, providing key. | 124 // 2. Schedule a task to handle the call, providing key. |
| 125 m_pendingKeys.append(key); | 125 m_pendingKeys.append(key); |
| 126 m_addKeyTimer.startOneShot(0); | 126 m_addKeyTimer.startOneShot(0); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void MediaKeySession::addKeyTimerFired(Timer<MediaKeySession>*) | 129 void MediaKeySession::addKeyTimerFired(Timer<MediaKeySession>*) |
| 130 { | 130 { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 { | 195 { |
| 196 return EventTargetNames::MediaKeySession; | 196 return EventTargetNames::MediaKeySession; |
| 197 } | 197 } |
| 198 | 198 |
| 199 ExecutionContext* MediaKeySession::executionContext() const | 199 ExecutionContext* MediaKeySession::executionContext() const |
| 200 { | 200 { |
| 201 return ContextLifecycleObserver::executionContext(); | 201 return ContextLifecycleObserver::executionContext(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } | 204 } |
| OLD | NEW |