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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // 3. Let session be a new MediaKeySession object, and initialize it as | 162 // 3. Let session be a new MediaKeySession object, and initialize it as |
163 // follows: | 163 // follows: |
164 // (Initialization is performed in the constructor.) | 164 // (Initialization is performed in the constructor.) |
165 // 4. Return session. | 165 // 4. Return session. |
166 return MediaKeySession::create(scriptState, this, sessionType); | 166 return MediaKeySession::create(scriptState, this, sessionType); |
167 } | 167 } |
168 | 168 |
169 ScriptPromise MediaKeys::setServerCertificate( | 169 ScriptPromise MediaKeys::setServerCertificate( |
170 ScriptState* scriptState, | 170 ScriptState* scriptState, |
171 const DOMArrayPiece& serverCertificate) { | 171 const DOMArrayPiece& serverCertificate) { |
172 // From https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/enc
rypted-media.html#dom-setservercertificate: | 172 // From https://w3c.github.io/encrypted-media/#setServerCertificate |
173 // The setServerCertificate(serverCertificate) method provides a server | 173 // The setServerCertificate(serverCertificate) method provides a server |
174 // certificate to be used to encrypt messages to the license server. | 174 // certificate to be used to encrypt messages to the license server. |
175 // It must run the following steps: | 175 // It must run the following steps: |
176 // 1. If serverCertificate is an empty array, return a promise rejected | 176 // 1. If serverCertificate is an empty array, return a promise rejected |
177 // with a new DOMException whose name is "InvalidAccessError". | 177 // with a new DOMException whose name is "InvalidAccessError". |
178 if (!serverCertificate.byteLength()) { | 178 if (!serverCertificate.byteLength()) { |
179 return ScriptPromise::rejectWithDOMException( | 179 return ScriptPromise::rejectWithDOMException( |
180 scriptState, | 180 scriptState, |
181 DOMException::create(InvalidAccessError, | 181 DOMException::create(InvalidAccessError, |
182 "The serverCertificate parameter is empty.")); | 182 "The serverCertificate parameter is empty.")); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 296 |
297 void MediaKeys::stop() { | 297 void MediaKeys::stop() { |
298 ActiveDOMObject::stop(); | 298 ActiveDOMObject::stop(); |
299 | 299 |
300 if (m_timer.isActive()) | 300 if (m_timer.isActive()) |
301 m_timer.stop(); | 301 m_timer.stop(); |
302 m_pendingActions.clear(); | 302 m_pendingActions.clear(); |
303 } | 303 } |
304 | 304 |
305 } // namespace blink | 305 } // namespace blink |
OLD | NEW |