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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "platform/ContentType.h" | 43 #include "platform/ContentType.h" |
44 #include "platform/Logging.h" | 44 #include "platform/Logging.h" |
45 #include "platform/Timer.h" | 45 #include "platform/Timer.h" |
46 #include "public/platform/WebContentDecryptionModule.h" | 46 #include "public/platform/WebContentDecryptionModule.h" |
47 #include "public/platform/WebContentDecryptionModuleException.h" | 47 #include "public/platform/WebContentDecryptionModuleException.h" |
48 #include "public/platform/WebContentDecryptionModuleSession.h" | 48 #include "public/platform/WebContentDecryptionModuleSession.h" |
49 #include "public/platform/WebEncryptedMediaKeyInformation.h" | 49 #include "public/platform/WebEncryptedMediaKeyInformation.h" |
50 #include "public/platform/WebString.h" | 50 #include "public/platform/WebString.h" |
51 #include "public/platform/WebURL.h" | 51 #include "public/platform/WebURL.h" |
52 #include "wtf/ASCIICType.h" | 52 #include "wtf/ASCIICType.h" |
| 53 #include "wtf/PtrUtil.h" |
53 #include <cmath> | 54 #include <cmath> |
54 #include <limits> | 55 #include <limits> |
55 | 56 |
56 #define MEDIA_KEY_SESSION_LOG_LEVEL 3 | 57 #define MEDIA_KEY_SESSION_LOG_LEVEL 3 |
57 | 58 |
58 namespace { | 59 namespace { |
59 | 60 |
60 // Minimum and maximum length for session ids. | 61 // Minimum and maximum length for session ids. |
61 enum { | 62 enum { |
62 MinSessionIdLength = 1, | 63 MinSessionIdLength = 1, |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 , m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), this
, ClosedPromise::Closed)) | 325 , m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), this
, ClosedPromise::Closed)) |
325 , m_actionTimer(this, &MediaKeySession::actionTimerFired) | 326 , m_actionTimer(this, &MediaKeySession::actionTimerFired) |
326 { | 327 { |
327 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __FUNCTION__ << "(" << this << ")"; | 328 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __FUNCTION__ << "(" << this << ")"; |
328 ThreadState::current()->registerPreFinalizer(this); | 329 ThreadState::current()->registerPreFinalizer(this); |
329 | 330 |
330 // Create the matching Chromium object. It will not be usable until | 331 // Create the matching Chromium object. It will not be usable until |
331 // initializeNewSession() is called in response to the user calling | 332 // initializeNewSession() is called in response to the user calling |
332 // generateRequest(). | 333 // generateRequest(). |
333 WebContentDecryptionModule* cdm = mediaKeys->contentDecryptionModule(); | 334 WebContentDecryptionModule* cdm = mediaKeys->contentDecryptionModule(); |
334 m_session = adoptPtr(cdm->createSession()); | 335 m_session = wrapUnique(cdm->createSession()); |
335 m_session->setClientInterface(this); | 336 m_session->setClientInterface(this); |
336 | 337 |
337 // From https://w3c.github.io/encrypted-media/#createSession: | 338 // From https://w3c.github.io/encrypted-media/#createSession: |
338 // MediaKeys::createSession(), step 3. | 339 // MediaKeys::createSession(), step 3. |
339 // 3.1 Let the sessionId attribute be the empty string. | 340 // 3.1 Let the sessionId attribute be the empty string. |
340 DCHECK(sessionId().isEmpty()); | 341 DCHECK(sessionId().isEmpty()); |
341 | 342 |
342 // 3.2 Let the expiration attribute be NaN. | 343 // 3.2 Let the expiration attribute be NaN. |
343 DCHECK(std::isnan(m_expiration)); | 344 DCHECK(std::isnan(m_expiration)); |
344 | 345 |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 visitor->trace(m_asyncEventQueue); | 927 visitor->trace(m_asyncEventQueue); |
927 visitor->trace(m_pendingActions); | 928 visitor->trace(m_pendingActions); |
928 visitor->trace(m_mediaKeys); | 929 visitor->trace(m_mediaKeys); |
929 visitor->trace(m_keyStatusesMap); | 930 visitor->trace(m_keyStatusesMap); |
930 visitor->trace(m_closedPromise); | 931 visitor->trace(m_closedPromise); |
931 EventTargetWithInlineData::trace(visitor); | 932 EventTargetWithInlineData::trace(visitor); |
932 ActiveDOMObject::trace(visitor); | 933 ActiveDOMObject::trace(visitor); |
933 } | 934 } |
934 | 935 |
935 } // namespace blink | 936 } // namespace blink |
OLD | NEW |