OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_ |
6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_ | 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
11 #include "media/base/cdm_factory.h" | |
12 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleAccess.h" | 9 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleAccess.h" |
| 10 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
13 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" | 11 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" |
| 12 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
14 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
15 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | |
16 | |
17 namespace blink { | |
18 class WebLocalFrame; | |
19 } | |
20 | 14 |
21 namespace media { | 15 namespace media { |
22 | 16 |
23 class WebEncryptedMediaClientImpl; | 17 class WebEncryptedMediaClientImpl; |
24 | 18 |
25 class WebContentDecryptionModuleAccessImpl | 19 class WebContentDecryptionModuleAccessImpl |
26 : public blink::WebContentDecryptionModuleAccess { | 20 : public blink::WebContentDecryptionModuleAccess { |
27 public: | 21 public: |
28 static WebContentDecryptionModuleAccessImpl* Create( | 22 static WebContentDecryptionModuleAccessImpl* Create( |
29 const blink::WebString& key_system, | 23 const blink::WebString& key_system, |
30 const blink::WebMediaKeySystemConfiguration& configuration, | 24 const blink::WebMediaKeySystemConfiguration& configuration, |
31 const blink::WebSecurityOrigin& security_origin, | 25 const blink::WebSecurityOrigin& security_origin, |
32 const base::WeakPtr<WebEncryptedMediaClientImpl>& client); | 26 const base::WeakPtr<WebEncryptedMediaClientImpl>& client); |
33 virtual ~WebContentDecryptionModuleAccessImpl(); | 27 virtual ~WebContentDecryptionModuleAccessImpl(); |
34 | 28 |
35 // blink::WebContentDecryptionModuleAccess interface. | 29 // blink::WebContentDecryptionModuleAccess interface. |
36 virtual blink::WebMediaKeySystemConfiguration getConfiguration(); | 30 virtual blink::WebMediaKeySystemConfiguration getConfiguration(); |
37 virtual void createContentDecryptionModule( | 31 virtual void createContentDecryptionModule( |
38 blink::WebContentDecryptionModuleResult result); | 32 blink::WebContentDecryptionModuleResult result); |
39 | 33 |
40 private: | 34 private: |
41 WebContentDecryptionModuleAccessImpl( | 35 WebContentDecryptionModuleAccessImpl( |
42 const blink::WebString& key_system, | 36 const blink::WebString& key_system, |
43 const blink::WebMediaKeySystemConfiguration& configuration, | 37 const blink::WebMediaKeySystemConfiguration& configuration, |
44 const blink::WebSecurityOrigin& security_origin, | 38 const blink::WebSecurityOrigin& security_origin, |
45 const base::WeakPtr<WebEncryptedMediaClientImpl>& client); | 39 const base::WeakPtr<WebEncryptedMediaClientImpl>& client); |
46 | 40 |
47 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleAccessImpl); | |
48 | |
49 blink::WebString key_system_; | 41 blink::WebString key_system_; |
50 blink::WebMediaKeySystemConfiguration configuration_; | 42 blink::WebMediaKeySystemConfiguration configuration_; |
51 blink::WebSecurityOrigin security_origin_; | 43 blink::WebSecurityOrigin security_origin_; |
52 | 44 |
53 // Keep a WeakPtr as client is owned by render_frame_impl. | 45 // Keep a WeakPtr as client is owned by render_frame_impl. |
54 base::WeakPtr<WebEncryptedMediaClientImpl> client_; | 46 base::WeakPtr<WebEncryptedMediaClientImpl> client_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleAccessImpl); |
55 }; | 49 }; |
56 | 50 |
57 } // namespace media | 51 } // namespace media |
58 | 52 |
59 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_ | 53 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULEACCESS_IMPL_H_ |
OLD | NEW |