| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const blink::WebSecurityOrigin& security_origin, | 36 const blink::WebSecurityOrigin& security_origin, |
| 37 const CdmConfig& cdm_config, | 37 const CdmConfig& cdm_config, |
| 38 scoped_ptr<blink::WebContentDecryptionModuleResult> result); | 38 scoped_ptr<blink::WebContentDecryptionModuleResult> result); |
| 39 | 39 |
| 40 ~WebContentDecryptionModuleImpl() override; | 40 ~WebContentDecryptionModuleImpl() override; |
| 41 | 41 |
| 42 // blink::WebContentDecryptionModule implementation. | 42 // blink::WebContentDecryptionModule implementation. |
| 43 blink::WebContentDecryptionModuleSession* createSession() override; | 43 blink::WebContentDecryptionModuleSession* createSession() override; |
| 44 | 44 |
| 45 void setServerCertificate( | 45 void setServerCertificate( |
| 46 const uint8* server_certificate, | 46 const uint8_t* server_certificate, |
| 47 size_t server_certificate_length, | 47 size_t server_certificate_length, |
| 48 blink::WebContentDecryptionModuleResult result) override; | 48 blink::WebContentDecryptionModuleResult result) override; |
| 49 | 49 |
| 50 // Returns the CdmContext associated with this CDM, which must not be nullptr. | 50 // Returns the CdmContext associated with this CDM, which must not be nullptr. |
| 51 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor | 51 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor |
| 52 // after WebContentDecryptionModule is freed. http://crbug.com/330324 | 52 // after WebContentDecryptionModule is freed. http://crbug.com/330324 |
| 53 CdmContext* GetCdmContext(); | 53 CdmContext* GetCdmContext(); |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 friend CdmSessionAdapter; | 56 friend CdmSessionAdapter; |
| 57 | 57 |
| 58 // Takes reference to |adapter|. | 58 // Takes reference to |adapter|. |
| 59 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); | 59 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); |
| 60 | 60 |
| 61 scoped_refptr<CdmSessionAdapter> adapter_; | 61 scoped_refptr<CdmSessionAdapter> adapter_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); | 63 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Allow typecasting from blink type as this is the only implementation. | 66 // Allow typecasting from blink type as this is the only implementation. |
| 67 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( | 67 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( |
| 68 blink::WebContentDecryptionModule* cdm) { | 68 blink::WebContentDecryptionModule* cdm) { |
| 69 return static_cast<WebContentDecryptionModuleImpl*>(cdm); | 69 return static_cast<WebContentDecryptionModuleImpl*>(cdm); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace media | 72 } // namespace media |
| 73 | 73 |
| 74 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 74 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
| OLD | NEW |