| 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 // FIXME(crbug.com/536816): |
| 155 // Use createOrNull instead of deprecatedCreateOrCrash. It would probably |
| 156 // be appropriate to reject the promise with a RangeError exception when |
| 157 // array buffer allocation fails, but that behavior probably needs |
| 158 // clarification in the spec. |
| 159 RefPtr<DOMArrayBuffer> serverCertificateBuffer = DOMArrayBuffer::deprecatedC
reateOrCrash(serverCertificate.data(), serverCertificate.byteLength()); |
| 155 | 160 |
| 156 // 4. Let promise be a new promise. | 161 // 4. Let promise be a new promise. |
| 157 SimpleContentDecryptionModuleResultPromise* result = new SimpleContentDecryp
tionModuleResultPromise(scriptState); | 162 SimpleContentDecryptionModuleResultPromise* result = new SimpleContentDecryp
tionModuleResultPromise(scriptState); |
| 158 ScriptPromise promise = result->promise(); | 163 ScriptPromise promise = result->promise(); |
| 159 | 164 |
| 160 // 5. Run the following steps asynchronously (documented in timerFired()). | 165 // 5. Run the following steps asynchronously (documented in timerFired()). |
| 161 m_pendingActions.append(PendingAction::CreatePendingSetServerCertificate(res
ult, serverCertificateBuffer.release())); | 166 m_pendingActions.append(PendingAction::CreatePendingSetServerCertificate(res
ult, serverCertificateBuffer.release())); |
| 162 if (!m_timer.isActive()) | 167 if (!m_timer.isActive()) |
| 163 m_timer.startOneShot(0, BLINK_FROM_HERE); | 168 m_timer.startOneShot(0, BLINK_FROM_HERE); |
| 164 | 169 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void MediaKeys::stop() | 269 void MediaKeys::stop() |
| 265 { | 270 { |
| 266 ActiveDOMObject::stop(); | 271 ActiveDOMObject::stop(); |
| 267 | 272 |
| 268 if (m_timer.isActive()) | 273 if (m_timer.isActive()) |
| 269 m_timer.stop(); | 274 m_timer.stop(); |
| 270 m_pendingActions.clear(); | 275 m_pendingActions.clear(); |
| 271 } | 276 } |
| 272 | 277 |
| 273 } // namespace blink | 278 } // namespace blink |
| OLD | NEW |