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 CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 const base::string16& key_system); | 29 const base::string16& key_system); |
30 | 30 |
31 virtual ~WebContentDecryptionModuleImpl(); | 31 virtual ~WebContentDecryptionModuleImpl(); |
32 | 32 |
33 // Returns the Decryptor associated with this CDM. May be NULL if no | 33 // Returns the Decryptor associated with this CDM. May be NULL if no |
34 // Decryptor associated with the MediaKeys object. | 34 // Decryptor associated with the MediaKeys object. |
35 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor | 35 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor |
36 // after WebContentDecryptionModule is freed. http://crbug.com/330324 | 36 // after WebContentDecryptionModule is freed. http://crbug.com/330324 |
37 media::Decryptor* GetDecryptor(); | 37 media::Decryptor* GetDecryptor(); |
38 | 38 |
| 39 #if defined(OS_ANDROID) |
| 40 // Returns the CDM ID associated with this object. May be kInvalidCdmId if no |
| 41 // CDM ID is associated. |
| 42 int GetCdmId(); |
| 43 #endif // defined(OS_ANDROID) |
| 44 |
39 // blink::WebContentDecryptionModule implementation. | 45 // blink::WebContentDecryptionModule implementation. |
40 virtual blink::WebContentDecryptionModuleSession* createSession( | 46 virtual blink::WebContentDecryptionModuleSession* createSession( |
41 blink::WebContentDecryptionModuleSession::Client* client); | 47 blink::WebContentDecryptionModuleSession::Client* client); |
42 | 48 |
43 private: | 49 private: |
44 // Takes reference to |adapter|. | 50 // Takes reference to |adapter|. |
| 51 #if defined(OS_ANDROID) |
| 52 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter, |
| 53 int cdm_id); |
| 54 #else |
45 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); | 55 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); |
| 56 #endif |
46 | 57 |
47 scoped_refptr<CdmSessionAdapter> adapter_; | 58 scoped_refptr<CdmSessionAdapter> adapter_; |
48 | 59 |
| 60 #if defined(OS_ANDROID) |
| 61 int cdm_id_; |
| 62 #endif // defined(OS_ANDROID) |
| 63 |
49 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); | 64 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); |
50 }; | 65 }; |
51 | 66 |
52 // Allow typecasting from blink type as this is the only implementation. | 67 // Allow typecasting from blink type as this is the only implementation. |
53 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( | 68 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( |
54 blink::WebContentDecryptionModule* cdm) { | 69 blink::WebContentDecryptionModule* cdm) { |
55 return static_cast<WebContentDecryptionModuleImpl*>(cdm); | 70 return static_cast<WebContentDecryptionModuleImpl*>(cdm); |
56 } | 71 } |
57 | 72 |
58 } // namespace content | 73 } // namespace content |
59 | 74 |
60 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 75 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
OLD | NEW |