diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-15 04:42:43 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-15 04:42:43 +0000 |
commit | ff41739978fb88dc0334f8bf2546e6ee8eaf5a0e (patch) | |
tree | 6df3c69f6d788bc95c80109cee09f1b3881b7391 /webkit | |
parent | ec2e2f697e94600cb16b53f2b9c88664526a4982 (diff) | |
download | chromium_src-ff41739978fb88dc0334f8bf2546e6ee8eaf5a0e.zip chromium_src-ff41739978fb88dc0334f8bf2546e6ee8eaf5a0e.tar.gz chromium_src-ff41739978fb88dc0334f8bf2546e6ee8eaf5a0e.tar.bz2 |
Change AesDecryptor::Decrypt to be an asynchronous call.
BUG=125401
TEST=media_tests, media layout tests.
Review URL: https://chromiumcodereview.appspot.com/10561014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/media/crypto/proxy_decryptor.cc | 9 | ||||
-rw-r--r-- | webkit/media/crypto/proxy_decryptor.h | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/webkit/media/crypto/proxy_decryptor.cc b/webkit/media/crypto/proxy_decryptor.cc index e44e6f4..0c96464 100644 --- a/webkit/media/crypto/proxy_decryptor.cc +++ b/webkit/media/crypto/proxy_decryptor.cc @@ -52,8 +52,9 @@ void ProxyDecryptor::CancelKeyRequest(const std::string& key_system, decryptor_->CancelKeyRequest(key_system, session_id); } -scoped_refptr<media::DecoderBuffer> ProxyDecryptor::Decrypt( - const scoped_refptr<media::DecoderBuffer>& input) { +void ProxyDecryptor::Decrypt( + const scoped_refptr<media::DecoderBuffer>& encrypted, + const DecryptCB& decrypt_cb) { // This is safe as we do not replace/delete an existing decryptor at run-time. Decryptor* decryptor = NULL; { @@ -61,9 +62,9 @@ scoped_refptr<media::DecoderBuffer> ProxyDecryptor::Decrypt( decryptor = decryptor_.get(); } if (!decryptor) - return NULL; + decrypt_cb.Run(kError, NULL); - return decryptor->Decrypt(input); + return decryptor->Decrypt(encrypted, decrypt_cb); } } // namespace webkit_media diff --git a/webkit/media/crypto/proxy_decryptor.h b/webkit/media/crypto/proxy_decryptor.h index e1672e1..335bdaf 100644 --- a/webkit/media/crypto/proxy_decryptor.h +++ b/webkit/media/crypto/proxy_decryptor.h @@ -38,8 +38,8 @@ class ProxyDecryptor : public media::Decryptor { const std::string& session_id) OVERRIDE; virtual void CancelKeyRequest(const std::string& key_system, const std::string& session_id) OVERRIDE; - virtual scoped_refptr<media::DecoderBuffer> Decrypt( - const scoped_refptr<media::DecoderBuffer>& input) OVERRIDE; + virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, + const DecryptCB& decrypt_cb) OVERRIDE; private: media::DecryptorClient* const client_; |