summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-03 05:55:30 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-03 05:55:30 +0000
commitc7c80b2a314ab142aee04fdb0f78532e82c4b2fa (patch)
treeebdf0119221c60ad1cb64ec99f8bba65df529b24 /media
parent4474cfde7eff8434e763a386740750896f2998c1 (diff)
downloadchromium_src-c7c80b2a314ab142aee04fdb0f78532e82c4b2fa.zip
chromium_src-c7c80b2a314ab142aee04fdb0f78532e82c4b2fa.tar.gz
chromium_src-c7c80b2a314ab142aee04fdb0f78532e82c4b2fa.tar.bz2
Refactor ProxyDecryptor.
- Add a message loop so that we don't need the DecryptOnMessageLoop magic (and headache). - Only supports one pending DecryptCB and removes the vector of pending callbacks. - Fix the Seek() bug/regression introduced in r158457. - Guard against more edge cases (see the updated unittests). - Updated unittests. BUG=152589 TEST=media_unittests, content_unittests, demo page plays/seeks well. Review URL: https://chromiumcodereview.appspot.com/10979084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/decryptor.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/media/base/decryptor.h b/media/base/decryptor.h
index a222ccd..01372cb 100644
--- a/media/base/decryptor.h
+++ b/media/base/decryptor.h
@@ -67,7 +67,8 @@ class MEDIA_EXPORT Decryptor {
// Decrypts the |encrypted| buffer. The decrypt status and decrypted buffer
// are returned via the provided callback |decrypt_cb|. The |encrypted| buffer
// must not be NULL.
- //
+ // Decrypt() should not be called until any previous DecryptCB has completed.
+ // Thus, only one DecryptCB may be pending at a time.
// Note that the callback maybe called synchronously or asynchronously.
//
// If the returned status is kSuccess, the |encrypted| buffer is successfully
@@ -81,8 +82,9 @@ class MEDIA_EXPORT Decryptor {
virtual void Decrypt(const scoped_refptr<DecoderBuffer>& encrypted,
const DecryptCB& decrypt_cb) = 0;
- // Cancel scheduled decryption operations and fires any pending DecryptCB
- // immediately with kError and NULL buffer.
+ // Cancels the scheduled decryption operation and fires the pending DecryptCB
+ // immediately with kSuccess and NULL.
+ // Decrypt() should not be called again before the pending DecryptCB is fired.
virtual void CancelDecrypt() = 0;
private: