Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1165)

Unified Diff: media/base/decryptor.h

Issue 11226019: Encrypted Media: Replace DecryptorClient with key event callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase again Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/decryptor_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decryptor.h
diff --git a/media/base/decryptor.h b/media/base/decryptor.h
index fd51c96f7fb623ccaf72d46e2ef952ae496547ec..4cc05a150a0bf7afbc976bdef3afd82936e67674 100644
--- a/media/base/decryptor.h
+++ b/media/base/decryptor.h
@@ -90,16 +90,16 @@ class MEDIA_EXPORT Decryptor {
virtual void CancelKeyRequest(const std::string& key_system,
const std::string& session_id) = 0;
- // Indicates that a key has been added to the Decryptor.
- typedef base::Callback<void()> KeyAddedCB;
+ // Indicates that a new key has been added to the Decryptor.
+ typedef base::Callback<void()> NewKeyCB;
tfarina 2013/01/26 16:05:23 base::Closure?
xhwang 2013/01/30 04:25:07 You are right. Thanks for pointing this out. I'll
- // Registers a KeyAddedCB which should be called when a key is added to the
- // decryptor. Only one KeyAddedCB can be registered for one |stream_type|.
+ // Registers a NewKeyCB which should be called when a new key is added to the
+ // decryptor. Only one NewKeyCB can be registered for one |stream_type|.
// If this function is called multiple times for the same |stream_type|, the
// previously registered callback will be replaced. In other words,
// registering a null callback cancels the originally registered callback.
- virtual void RegisterKeyAddedCB(StreamType stream_type,
- const KeyAddedCB& key_added_cb) = 0;
+ virtual void RegisterNewKeyCB(StreamType stream_type,
+ const NewKeyCB& key_added_cb) = 0;
// Indicates completion of a decryption operation.
//
@@ -216,6 +216,28 @@ typedef base::Callback<void(Decryptor*)> DecryptorReadyCB;
// fired immediately with NULL.
typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB;
+
+// Key event callbacks. See the spec for details:
+// http://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html#event-summary
+typedef base::Callback<void(const std::string& key_system,
+ const std::string& session_id)> KeyAddedCB;
+
+typedef base::Callback<void(const std::string& key_system,
+ const std::string& session_id,
+ media::Decryptor::KeyError error_code,
+ int system_code)> KeyErrorCB;
+
+typedef base::Callback<void(const std::string& key_system,
+ const std::string& session_id,
+ const std::string& message,
+ const std::string& default_url)> KeyMessageCB;
+
+typedef base::Callback<void(const std::string& key_system,
+ const std::string& session_id,
+ const std::string& type,
+ scoped_array<uint8> init_data,
+ int init_data_size)> NeedKeyCB;
+
} // namespace media
#endif // MEDIA_BASE_DECRYPTOR_H_
« no previous file with comments | « no previous file | media/base/decryptor_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698