OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
6 #define WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void DecryptOnMessageLoop( | 68 void DecryptOnMessageLoop( |
69 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, | 69 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, |
70 const scoped_refptr<media::DecoderBuffer>& encrypted, | 70 const scoped_refptr<media::DecoderBuffer>& encrypted, |
71 const media::Decryptor::DecryptCB& decrypt_cb); | 71 const media::Decryptor::DecryptCB& decrypt_cb); |
72 | 72 |
73 // Callback used to pass into decryptor_->Decrypt(). | 73 // Callback used to pass into decryptor_->Decrypt(). |
74 void OnBufferDecrypted( | 74 void OnBufferDecrypted( |
75 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, | 75 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, |
76 const scoped_refptr<media::DecoderBuffer>& encrypted, | 76 const scoped_refptr<media::DecoderBuffer>& encrypted, |
77 const media::Decryptor::DecryptCB& decrypt_cb, | 77 const media::Decryptor::DecryptCB& decrypt_cb, |
78 media::Decryptor::DecryptStatus status, | 78 media::Decryptor::Status status, |
79 const scoped_refptr<media::DecoderBuffer>& decrypted); | 79 const scoped_refptr<media::DecoderBuffer>& decrypted); |
80 | 80 |
81 media::DecryptorClient* client_; | 81 media::DecryptorClient* client_; |
82 | 82 |
83 // Needed to create the PpapiDecryptor. | 83 // Needed to create the PpapiDecryptor. |
84 WebKit::WebMediaPlayerClient* web_media_player_client_; | 84 WebKit::WebMediaPlayerClient* web_media_player_client_; |
85 WebKit::WebFrame* web_frame_; | 85 WebKit::WebFrame* web_frame_; |
86 | 86 |
87 // Protects the |decryptor_| and |pending_decrypt_closures_|. Note that | 87 // Protects the |decryptor_| and |pending_decrypt_closures_|. Note that |
88 // |decryptor_| itself should be thread safe as per the Decryptor interface. | 88 // |decryptor_| itself should be thread safe as per the Decryptor interface. |
89 base::Lock lock_; | 89 base::Lock lock_; |
90 scoped_ptr<media::Decryptor> decryptor_; | 90 scoped_ptr<media::Decryptor> decryptor_; |
91 std::vector<base::Closure> pending_decrypt_closures_; | 91 std::vector<base::Closure> pending_decrypt_closures_; |
92 bool stopped_; | 92 bool stopped_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); | 94 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); |
95 }; | 95 }; |
96 | 96 |
97 } // namespace webkit_media | 97 } // namespace webkit_media |
98 | 98 |
99 #endif // WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 99 #endif // WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
OLD | NEW |