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