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_CRYPTO_AES_DECRYPTOR_H_ | 5 #ifndef MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
6 #define MEDIA_CRYPTO_AES_DECRYPTOR_H_ | 6 #define MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/containers/scoped_ptr_hash_map.h" | 12 #include "base/containers/scoped_ptr_hash_map.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "media/base/cdm_context.h" | 16 #include "media/base/cdm_context.h" |
17 #include "media/base/decryptor.h" | 17 #include "media/base/decryptor.h" |
18 #include "media/base/media_export.h" | 18 #include "media/base/media_export.h" |
19 #include "media/base/media_keys.h" | 19 #include "media/base/media_keys.h" |
20 | 20 |
| 21 class GURL; |
| 22 |
21 namespace crypto { | 23 namespace crypto { |
22 class SymmetricKey; | 24 class SymmetricKey; |
23 } | 25 } |
24 | 26 |
25 namespace media { | 27 namespace media { |
26 | 28 |
27 // Decrypts an AES encrypted buffer into an unencrypted buffer. The AES | 29 // Decrypts an AES encrypted buffer into an unencrypted buffer. The AES |
28 // encryption must be CTR with a key size of 128bits. | 30 // encryption must be CTR with a key size of 128bits. |
29 class MEDIA_EXPORT AesDecryptor : public MediaKeys, | 31 class MEDIA_EXPORT AesDecryptor : public MediaKeys, |
30 public CdmContext, | 32 public CdmContext, |
31 public Decryptor { | 33 public Decryptor { |
32 public: | 34 public: |
33 AesDecryptor(const SessionMessageCB& session_message_cb, | 35 AesDecryptor(const GURL& security_origin, |
| 36 const SessionMessageCB& session_message_cb, |
34 const SessionClosedCB& session_closed_cb, | 37 const SessionClosedCB& session_closed_cb, |
35 const SessionKeysChangeCB& session_keys_change_cb); | 38 const SessionKeysChangeCB& session_keys_change_cb); |
36 ~AesDecryptor() override; | 39 ~AesDecryptor() override; |
37 | 40 |
38 // MediaKeys implementation. | 41 // MediaKeys implementation. |
39 void SetServerCertificate(const uint8* certificate_data, | 42 void SetServerCertificate(const uint8* certificate_data, |
40 int certificate_data_length, | 43 int certificate_data_length, |
41 scoped_ptr<SimpleCdmPromise> promise) override; | 44 scoped_ptr<SimpleCdmPromise> promise) override; |
42 void CreateSessionAndGenerateRequest( | 45 void CreateSessionAndGenerateRequest( |
43 SessionType session_type, | 46 SessionType session_type, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Protect |new_audio_key_cb_| and |new_video_key_cb_| as they are set on the | 157 // Protect |new_audio_key_cb_| and |new_video_key_cb_| as they are set on the |
155 // main thread but called on the media thread. | 158 // main thread but called on the media thread. |
156 mutable base::Lock new_key_cb_lock_; | 159 mutable base::Lock new_key_cb_lock_; |
157 | 160 |
158 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); | 161 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); |
159 }; | 162 }; |
160 | 163 |
161 } // namespace media | 164 } // namespace media |
162 | 165 |
163 #endif // MEDIA_CRYPTO_AES_DECRYPTOR_H_ | 166 #endif // MEDIA_CRYPTO_AES_DECRYPTOR_H_ |
OLD | NEW |