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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const uint8* server_certificate, | 45 const uint8* server_certificate, |
46 size_t server_certificate_length, | 46 size_t server_certificate_length, |
47 blink::WebContentDecryptionModuleResult result); | 47 blink::WebContentDecryptionModuleResult result); |
48 | 48 |
49 // Returns the CdmContext associated with this CDM, which must not be nullptr. | 49 // Returns the CdmContext associated with this CDM, which must not be nullptr. |
50 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor | 50 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor |
51 // after WebContentDecryptionModule is freed. http://crbug.com/330324 | 51 // after WebContentDecryptionModule is freed. http://crbug.com/330324 |
52 CdmContext* GetCdmContext(); | 52 CdmContext* GetCdmContext(); |
53 | 53 |
54 private: | 54 private: |
| 55 friend CdmSessionAdapter; |
| 56 |
55 // Takes reference to |adapter|. | 57 // Takes reference to |adapter|. |
56 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); | 58 WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter); |
57 | 59 |
58 scoped_refptr<CdmSessionAdapter> adapter_; | 60 scoped_refptr<CdmSessionAdapter> adapter_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); | 62 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); |
61 }; | 63 }; |
62 | 64 |
63 // Allow typecasting from blink type as this is the only implementation. | 65 // Allow typecasting from blink type as this is the only implementation. |
64 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( | 66 inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl( |
65 blink::WebContentDecryptionModule* cdm) { | 67 blink::WebContentDecryptionModule* cdm) { |
66 return static_cast<WebContentDecryptionModuleImpl*>(cdm); | 68 return static_cast<WebContentDecryptionModuleImpl*>(cdm); |
67 } | 69 } |
68 | 70 |
69 } // namespace media | 71 } // namespace media |
70 | 72 |
71 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 73 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
OLD | NEW |