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