| 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 // Returns the CDM ID associated with this object. May be kInvalidCdmId if no |
| 40 // CDM ID is associated. |
| 41 int GetCdmId(); |
| 42 |
| 39 // blink::WebContentDecryptionModule implementation. | 43 // blink::WebContentDecryptionModule implementation. |
| 40 virtual blink::WebContentDecryptionModuleSession* createSession( | 44 virtual blink::WebContentDecryptionModuleSession* createSession( |
| 41 blink::WebContentDecryptionModuleSession::Client* client); | 45 blink::WebContentDecryptionModuleSession::Client* client); |
| 42 | 46 |
| 43 private: | 47 private: |
| 44 // Takes reference to |adapter|. | 48 // Takes reference to |adapter|. |
| 45 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); | 49 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); |
| 46 | 50 |
| 47 scoped_refptr<CdmSessionAdapter> adapter_; | 51 scoped_refptr<CdmSessionAdapter> adapter_; |
| 48 | 52 |
| 49 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); | 53 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); |
| 50 }; | 54 }; |
| 51 | 55 |
| 52 // Allow typecasting from blink type as this is the only implementation. | 56 // Allow typecasting from blink type as this is the only implementation. |
| 53 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( | 57 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( |
| 54 blink::WebContentDecryptionModule* cdm) { | 58 blink::WebContentDecryptionModule* cdm) { |
| 55 return static_cast<WebContentDecryptionModuleImpl*>(cdm); | 59 return static_cast<WebContentDecryptionModuleImpl*>(cdm); |
| 56 } | 60 } |
| 57 | 61 |
| 58 } // namespace content | 62 } // namespace content |
| 59 | 63 |
| 60 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 64 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| OLD | NEW |