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 21 matching lines...) Expand all Loading... |
32 #include "core/events/ThreadLocalEventNames.h" | 32 #include "core/events/ThreadLocalEventNames.h" |
33 #include "core/html/HTMLMediaElement.h" | 33 #include "core/html/HTMLMediaElement.h" |
34 #include "modules/encryptedmedia/MediaKeyMessageEvent.h" | 34 #include "modules/encryptedmedia/MediaKeyMessageEvent.h" |
35 #include "platform/Logging.h" | 35 #include "platform/Logging.h" |
36 #include "platform/UUID.h" | 36 #include "platform/UUID.h" |
37 #include "platform/drm/ContentDecryptionModule.h" | 37 #include "platform/drm/ContentDecryptionModule.h" |
38 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 DEFINE_GC_INFO(MediaKeys); | |
43 | |
44 PassRefPtrWillBeRawPtr<MediaKeys> MediaKeys::create(ExecutionContext* context, c
onst String& keySystem, ExceptionState& exceptionState) | 42 PassRefPtrWillBeRawPtr<MediaKeys> MediaKeys::create(ExecutionContext* context, c
onst String& keySystem, ExceptionState& exceptionState) |
45 { | 43 { |
46 // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/e
ncrypted-media.html#dom-media-keys-constructor>: | 44 // From <http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/e
ncrypted-media.html#dom-media-keys-constructor>: |
47 // The MediaKeys(keySystem) constructor must run the following steps: | 45 // The MediaKeys(keySystem) constructor must run the following steps: |
48 | 46 |
49 // 1. If keySystem is null or an empty string, throw an InvalidAccessError e
xception and abort these steps. | 47 // 1. If keySystem is null or an empty string, throw an InvalidAccessError e
xception and abort these steps. |
50 if (keySystem.isEmpty()) { | 48 if (keySystem.isEmpty()) { |
51 exceptionState.throwDOMException(InvalidAccessError, "The key system pro
vided is invalid."); | 49 exceptionState.throwDOMException(InvalidAccessError, "The key system pro
vided is invalid."); |
52 return nullptr; | 50 return nullptr; |
53 } | 51 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 165 |
168 void MediaKeys::contextDestroyed() | 166 void MediaKeys::contextDestroyed() |
169 { | 167 { |
170 ContextLifecycleObserver::contextDestroyed(); | 168 ContextLifecycleObserver::contextDestroyed(); |
171 | 169 |
172 // We don't need the CDM anymore. | 170 // We don't need the CDM anymore. |
173 m_cdm.clear(); | 171 m_cdm.clear(); |
174 } | 172 } |
175 | 173 |
176 } | 174 } |
OLD | NEW |