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

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: prototype cl of new approach 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..672410de681ebffc9469cee72d890a5844d7df13 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;
- // 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,26 @@ typedef base::Callback<void(Decryptor*)> DecryptorReadyCB;
// fired immediately with NULL.
typedef base::Callback<void(const DecryptorReadyCB&)> SetDecryptorReadyCB;
+// Key events callbacks.
Ami GONE FROM CHROMIUM 2012/12/20 18:33:55 Point to http://dvcs.w3.org/hg/html-media/raw-file
xhwang 2012/12/20 19:27:52 Done.
+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