Chromium Code Reviews| 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. | |
|
ddorwin
2014/03/25 23:03:59
Ditto about why this might happen.
xhwang
2014/03/26 06:02:04
ditto
| |
| 53 int GetCdmId(); | |
| 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( |
| 63 #if defined(OS_ANDROID) | |
| 64 scoped_refptr<CdmSessionAdapter> adapter, | |
| 65 int cdm_id); | |
|
ddorwin
2014/03/25 23:03:59
nit: if you flip the order, you only need to ifdef
xhwang
2014/03/26 06:02:04
Obsolete in PS4.
| |
| 66 #else | |
| 67 scoped_refptr<CdmSessionAdapter> adapter); | |
| 68 #endif | |
| 57 | 69 |
| 58 scoped_refptr<CdmSessionAdapter> adapter_; | 70 scoped_refptr<CdmSessionAdapter> adapter_; |
| 59 | 71 |
| 72 #if defined(OS_ANDROID) | |
| 73 int cdm_id_; | |
| 74 #endif // defined(OS_ANDROID) | |
| 75 | |
| 60 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); | 76 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); |
| 61 }; | 77 }; |
| 62 | 78 |
| 63 // Allow typecasting from blink type as this is the only implementation. | 79 // Allow typecasting from blink type as this is the only implementation. |
| 64 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( | 80 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( |
| 65 blink::WebContentDecryptionModule* cdm) { | 81 blink::WebContentDecryptionModule* cdm) { |
| 66 return static_cast<WebContentDecryptionModuleImpl*>(cdm); | 82 return static_cast<WebContentDecryptionModuleImpl*>(cdm); |
| 67 } | 83 } |
| 68 | 84 |
| 69 } // namespace content | 85 } // namespace content |
| 70 | 86 |
| 71 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 87 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| OLD | NEW |