1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "config.h"
6#include "web/MediaKeysClientImpl.h"
7
8#include "core/dom/Document.h"
9#include "core/dom/ExecutionContext.h"
10#include "public/platform/WebContentDecryptionModule.h"
11#include "public/web/WebFrameClient.h"
12#include "web/WebLocalFrameImpl.h"
13
14namespace blink {
15
16MediaKeysClientImpl::MediaKeysClientImpl()
17{
18}
19
20PassOwnPtr<WebContentDecryptionModule> MediaKeysClientImpl::createContentDecryptionModule(ExecutionContext* executionContext, const String& keySystem)
21{
22    Document* document = toDocument(executionContext);
23    WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
24    WebSecurityOrigin securityOrigin(executionContext->securityOrigin());
25    return adoptPtr(webFrame->client()->createContentDecryptionModule(webFrame, securityOrigin, keySystem));
26}
27
28} // namespace blink
29