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

Side by Side Diff: media/base/media_keys.h

Issue 17381007: EME: ProxyDecryptor creates MediaKeys instead of Decryptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 MEDIA_BASE_MEDIA_KEYS_H_ 5 #ifndef MEDIA_BASE_MEDIA_KEYS_H_
6 #define MEDIA_BASE_MEDIA_KEYS_H_ 6 #define MEDIA_BASE_MEDIA_KEYS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
14 14
15 namespace media { 15 namespace media {
16 16
17 class Decryptor;
18
17 // Performs media key operations. 19 // Performs media key operations.
18 // 20 //
19 // All key operations are called on the renderer thread. Therefore, these calls 21 // All key operations are called on the renderer thread. Therefore, these calls
20 // should be fast and nonblocking; key events should be fired asynchronously. 22 // should be fast and nonblocking; key events should be fired asynchronously.
21 class MEDIA_EXPORT MediaKeys { 23 class MEDIA_EXPORT MediaKeys {
22 public: 24 public:
23 // Reported to UMA, so never reuse a value! 25 // Reported to UMA, so never reuse a value!
24 // Must be kept in sync with WebKit::WebMediaPlayerClient::MediaKeyErrorCode 26 // Must be kept in sync with WebKit::WebMediaPlayerClient::MediaKeyErrorCode
25 // (enforced in webmediaplayer_impl.cc). 27 // (enforced in webmediaplayer_impl.cc).
26 enum KeyError { 28 enum KeyError {
(...skipping 25 matching lines...) Expand all
52 // key ID, the older key will be replaced by the newer key. 54 // key ID, the older key will be replaced by the newer key.
53 virtual void AddKey(const std::string& key_system, 55 virtual void AddKey(const std::string& key_system,
54 const uint8* key, int key_length, 56 const uint8* key, int key_length,
55 const uint8* init_data, int init_data_length, 57 const uint8* init_data, int init_data_length,
56 const std::string& session_id) = 0; 58 const std::string& session_id) = 0;
57 59
58 // Cancels the key request specified by |session_id|. 60 // Cancels the key request specified by |session_id|.
59 virtual void CancelKeyRequest(const std::string& key_system, 61 virtual void CancelKeyRequest(const std::string& key_system,
60 const std::string& session_id) = 0; 62 const std::string& session_id) = 0;
61 63
64 // Gets the Decryptor object associated with the MediaKeys. Returns NULL if
65 // no Decryptor object is associated. The returned object is only guaranteed
66 // to be valid during the MediaKeys' lifetime.
67 virtual Decryptor* GetDecryptor();
68
62 private: 69 private:
63 DISALLOW_COPY_AND_ASSIGN(MediaKeys); 70 DISALLOW_COPY_AND_ASSIGN(MediaKeys);
64 }; 71 };
65 72
66 // Key event callbacks. See the spec for details: 73 // Key event callbacks. See the spec for details:
67 // http://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted -media.html#event-summary 74 // http://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted -media.html#event-summary
68 typedef base::Callback<void(const std::string& key_system, 75 typedef base::Callback<void(const std::string& key_system,
69 const std::string& session_id)> KeyAddedCB; 76 const std::string& session_id)> KeyAddedCB;
70 77
71 typedef base::Callback<void(const std::string& key_system, 78 typedef base::Callback<void(const std::string& key_system,
72 const std::string& session_id, 79 const std::string& session_id,
73 media::MediaKeys::KeyError error_code, 80 media::MediaKeys::KeyError error_code,
74 int system_code)> KeyErrorCB; 81 int system_code)> KeyErrorCB;
75 82
76 typedef base::Callback<void(const std::string& key_system, 83 typedef base::Callback<void(const std::string& key_system,
77 const std::string& session_id, 84 const std::string& session_id,
78 const std::string& message, 85 const std::string& message,
79 const std::string& default_url)> KeyMessageCB; 86 const std::string& default_url)> KeyMessageCB;
80 87
81 typedef base::Callback<void(const std::string& key_system, 88 typedef base::Callback<void(const std::string& key_system,
82 const std::string& session_id, 89 const std::string& session_id,
83 const std::string& type, 90 const std::string& type,
84 scoped_ptr<uint8[]> init_data, 91 scoped_ptr<uint8[]> init_data,
85 int init_data_size)> NeedKeyCB; 92 int init_data_size)> NeedKeyCB;
86 93
87 } // namespace media 94 } // namespace media
88 95
89 #endif // MEDIA_BASE_MEDIA_KEYS_H_ 96 #endif // MEDIA_BASE_MEDIA_KEYS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698