Roll src/third_party/WebKit 26e7263:bda1fe3e (svn 201960:201962)
[chromium-blink-merge.git] / media / blink / webcontentdecryptionmoduleaccess_impl.h
blob5f156984e197aea6c43e1a2bab98b137ea30dfc4
1 // Copyright 2013 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.
5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_
6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_
8 #include "base/memory/weak_ptr.h"
9 #include "media/base/cdm_config.h"
10 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleAccess.h"
11 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
12 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h"
13 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
14 #include "third_party/WebKit/public/platform/WebString.h"
16 namespace media {
18 class WebEncryptedMediaClientImpl;
20 class WebContentDecryptionModuleAccessImpl
21 : public blink::WebContentDecryptionModuleAccess {
22 public:
23 static WebContentDecryptionModuleAccessImpl* Create(
24 const blink::WebString& key_system,
25 const blink::WebSecurityOrigin& security_origin,
26 const blink::WebMediaKeySystemConfiguration& configuration,
27 const CdmConfig& cdm_config,
28 const base::WeakPtr<WebEncryptedMediaClientImpl>& client);
29 virtual ~WebContentDecryptionModuleAccessImpl();
31 // blink::WebContentDecryptionModuleAccess interface.
32 virtual blink::WebMediaKeySystemConfiguration getConfiguration();
33 virtual void createContentDecryptionModule(
34 blink::WebContentDecryptionModuleResult result);
36 private:
37 WebContentDecryptionModuleAccessImpl(
38 const blink::WebString& key_system,
39 const blink::WebSecurityOrigin& security_origin,
40 const blink::WebMediaKeySystemConfiguration& configuration,
41 const CdmConfig& cdm_config,
42 const base::WeakPtr<WebEncryptedMediaClientImpl>& client);
44 const blink::WebString key_system_;
45 const blink::WebSecurityOrigin security_origin_;
46 const blink::WebMediaKeySystemConfiguration configuration_;
47 const CdmConfig cdm_config_;
49 // Keep a WeakPtr as client is owned by render_frame_impl.
50 base::WeakPtr<WebEncryptedMediaClientImpl> client_;
52 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleAccessImpl);
55 } // namespace media
57 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_