| Index: Source/modules/encryptedmedia/MediaKeys.cpp
|
| diff --git a/Source/modules/encryptedmedia/MediaKeys.cpp b/Source/modules/encryptedmedia/MediaKeys.cpp
|
| index b194898a779cea809761a51f4ba4a0ee2e0bd679..f628c50327acda6369722c07d35b7b667ebf1565 100644
|
| --- a/Source/modules/encryptedmedia/MediaKeys.cpp
|
| +++ b/Source/modules/encryptedmedia/MediaKeys.cpp
|
| @@ -28,10 +28,13 @@
|
|
|
| #include "bindings/v8/ExceptionState.h"
|
| #include "core/dom/ContextLifecycleObserver.h"
|
| +#include "core/dom/Document.h"
|
| #include "core/dom/ExecutionContext.h"
|
| #include "core/events/ThreadLocalEventNames.h"
|
| #include "core/html/HTMLMediaElement.h"
|
| #include "modules/encryptedmedia/MediaKeyMessageEvent.h"
|
| +#include "modules/encryptedmedia/MediaKeysClient.h"
|
| +#include "modules/encryptedmedia/MediaKeysController.h"
|
| #include "platform/ContentType.h"
|
| #include "platform/Logging.h"
|
| #include "platform/MIMETypeRegistry.h"
|
| @@ -70,7 +73,11 @@ PassRefPtrWillBeRawPtr<MediaKeys> MediaKeys::create(ExecutionContext* context, c
|
|
|
| // 3. Let cdm be the content decryption module corresponding to keySystem.
|
| // 4. Load cdm if necessary.
|
| - OwnPtr<blink::WebContentDecryptionModule> cdm = adoptPtr(blink::Platform::current()->createContentDecryptionModule(keySystem));
|
| + Document* document = toDocument(context);
|
| + ASSERT(document);
|
| + MediaKeysController* controller = MediaKeysController::from(document->page());
|
| + ASSERT(controller);
|
| + OwnPtr<blink::WebContentDecryptionModule> cdm = adoptPtr(controller->client()->createContentDecryptionModule(context, keySystem));
|
| if (!cdm) {
|
| exceptionState.throwDOMException(NotSupportedError, "A content decryption module could not be loaded for the '" + keySystem + "' key system.");
|
| return nullptr;
|
|
|