| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 scriptState, DOMException::create(InvalidAccessError, "The serverCer
tificate parameter is empty.")); | 144 scriptState, DOMException::create(InvalidAccessError, "The serverCer
tificate parameter is empty.")); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // 2. If the keySystem does not support server certificates, return a | 147 // 2. If the keySystem does not support server certificates, return a |
| 148 // promise rejected with a new DOMException whose name is | 148 // promise rejected with a new DOMException whose name is |
| 149 // "NotSupportedError". | 149 // "NotSupportedError". |
| 150 // (Let the CDM decide whether to support this or not.) | 150 // (Let the CDM decide whether to support this or not.) |
| 151 | 151 |
| 152 // 3. Let certificate be a copy of the contents of the serverCertificate | 152 // 3. Let certificate be a copy of the contents of the serverCertificate |
| 153 // parameter. | 153 // parameter. |
| 154 RefPtr<DOMArrayBuffer> serverCertificateBuffer = DOMArrayBuffer::create(serv
erCertificate.data(), serverCertificate.byteLength()); | 154 RefPtr<DOMArrayBuffer> serverCertificateBuffer = DOMArrayBuffer::createOrNul
l(serverCertificate.data(), serverCertificate.byteLength()); |
| 155 if (!serverCertificateBuffer) { |
| 156 return ScriptPromise::rejectWithDOMException( |
| 157 scriptState, DOMException::create(V8RangeError, "Out of Memory. Serv
er certificate buffer allocation failed.")); |
| 158 } |
| 155 | 159 |
| 156 // 4. Let promise be a new promise. | 160 // 4. Let promise be a new promise. |
| 157 SimpleContentDecryptionModuleResultPromise* result = new SimpleContentDecryp
tionModuleResultPromise(scriptState); | 161 SimpleContentDecryptionModuleResultPromise* result = new SimpleContentDecryp
tionModuleResultPromise(scriptState); |
| 158 ScriptPromise promise = result->promise(); | 162 ScriptPromise promise = result->promise(); |
| 159 | 163 |
| 160 // 5. Run the following steps asynchronously (documented in timerFired()). | 164 // 5. Run the following steps asynchronously (documented in timerFired()). |
| 161 m_pendingActions.append(PendingAction::CreatePendingSetServerCertificate(res
ult, serverCertificateBuffer.release())); | 165 m_pendingActions.append(PendingAction::CreatePendingSetServerCertificate(res
ult, serverCertificateBuffer.release())); |
| 162 if (!m_timer.isActive()) | 166 if (!m_timer.isActive()) |
| 163 m_timer.startOneShot(0, FROM_HERE); | 167 m_timer.startOneShot(0, FROM_HERE); |
| 164 | 168 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void MediaKeys::stop() | 268 void MediaKeys::stop() |
| 265 { | 269 { |
| 266 ActiveDOMObject::stop(); | 270 ActiveDOMObject::stop(); |
| 267 | 271 |
| 268 if (m_timer.isActive()) | 272 if (m_timer.isActive()) |
| 269 m_timer.stop(); | 273 m_timer.stop(); |
| 270 m_pendingActions.clear(); | 274 m_pendingActions.clear(); |
| 271 } | 275 } |
| 272 | 276 |
| 273 } // namespace blink | 277 } // namespace blink |
| OLD | NEW |