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 MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 | 46 |
| 47 // blink::WebContentDecryptionModule implementation. | 47 // blink::WebContentDecryptionModule implementation. |
| 48 blink::WebContentDecryptionModuleSession* createSession() override; | 48 blink::WebContentDecryptionModuleSession* createSession() override; |
| 49 | 49 |
| 50 void setServerCertificate( | 50 void setServerCertificate( |
| 51 const uint8_t* server_certificate, | 51 const uint8_t* server_certificate, |
| 52 size_t server_certificate_length, | 52 size_t server_certificate_length, |
| 53 blink::WebContentDecryptionModuleResult result) override; | 53 blink::WebContentDecryptionModuleResult result) override; |
| 54 | 54 |
| 55 // Returns the CdmContext associated with this CDM, which must not be nullptr. | 55 // Returns the CdmContext associated with this CDM, which must not be nullptr. |
| 56 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor | 56 // Caller should keep a reference using GetCdmAdapterReference() to keep the |
| 57 // after WebContentDecryptionModule is freed. http://crbug.com/330324 | 57 // CDM alive if necessary. |
| 58 CdmContext* GetCdmContext(); | 58 CdmContext* GetCdmContext(); |
| 59 | 59 |
| 60 // Returns a reference to this CDM adapter. | |
| 61 CdmSessionAdapter* GetCdmAdapterReference(); | |
|
xhwang
2016/10/07 05:02:14
This returns a raw pointer, not a reference... Ah,
jrummell
2016/10/07 20:15:30
Done.
| |
| 62 | |
| 60 private: | 63 private: |
| 61 friend CdmSessionAdapter; | 64 friend CdmSessionAdapter; |
| 62 | 65 |
| 63 // Takes reference to |adapter|. | 66 // Takes reference to |adapter|. |
| 64 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); | 67 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); |
| 65 | 68 |
| 66 scoped_refptr<CdmSessionAdapter> adapter_; | 69 scoped_refptr<CdmSessionAdapter> adapter_; |
| 67 | 70 |
| 68 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); | 71 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 // Allow typecasting from blink type as this is the only implementation. | 74 // Allow typecasting from blink type as this is the only implementation. |
| 72 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( | 75 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( |
| 73 blink::WebContentDecryptionModule* cdm) { | 76 blink::WebContentDecryptionModule* cdm) { |
| 74 return static_cast<WebContentDecryptionModuleImpl*>(cdm); | 77 return static_cast<WebContentDecryptionModuleImpl*>(cdm); |
| 75 } | 78 } |
| 76 | 79 |
| 77 } // namespace media | 80 } // namespace media |
| 78 | 81 |
| 79 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 82 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| OLD | NEW |