Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 class Decryptor; | 19 class Decryptor; |
| 20 | 20 |
| 21 template <typename T> | 21 template <typename T> |
| 22 class CdmPromiseTemplate; | 22 class CdmPromiseTemplate; |
| 23 | 23 |
| 24 typedef CdmPromiseTemplate<std::string> NewSessionCdmPromise; | 24 typedef CdmPromiseTemplate<std::string> NewSessionCdmPromise; |
| 25 typedef CdmPromiseTemplate<void> SimpleCdmPromise; | 25 typedef CdmPromiseTemplate<void> SimpleCdmPromise; |
| 26 typedef std::vector<std::vector<uint8> > KeyIdsVector; | |
| 27 typedef CdmPromiseTemplate<KeyIdsVector> KeyIdsPromise; | |
| 26 | 28 |
| 27 // Performs media key operations. | 29 // Performs media key operations. |
| 28 // | 30 // |
| 29 // All key operations are called on the renderer thread. Therefore, these calls | 31 // All key operations are called on the renderer thread. Therefore, these calls |
| 30 // should be fast and nonblocking; key events should be fired asynchronously. | 32 // should be fast and nonblocking; key events should be fired asynchronously. |
| 31 class MEDIA_EXPORT MediaKeys { | 33 class MEDIA_EXPORT MediaKeys { |
|
ddorwin
2014/08/08 23:36:23
Why isn't GetUsableKeyIds added to this interface?
jrummell
2014/08/11 18:59:03
I didn't do it in this CL since MediaKeys is used
| |
| 32 public: | 34 public: |
| 33 // Reported to UMA, so never reuse a value! | 35 // Reported to UMA, so never reuse a value! |
| 34 // Must be kept in sync with blink::WebMediaPlayerClient::MediaKeyErrorCode | 36 // Must be kept in sync with blink::WebMediaPlayerClient::MediaKeyErrorCode |
| 35 // (enforced in webmediaplayer_impl.cc). | 37 // (enforced in webmediaplayer_impl.cc). |
| 36 // TODO(jrummell): Can this be moved to proxy_decryptor as it should only be | 38 // TODO(jrummell): Can this be moved to proxy_decryptor as it should only be |
| 37 // used by the prefixed EME code? | 39 // used by the prefixed EME code? |
| 38 enum KeyError { | 40 enum KeyError { |
| 39 kUnknownError = 1, | 41 kUnknownError = 1, |
| 40 kClientError, | 42 kClientError, |
| 41 // The commented v0.1b values below have never been used. | 43 // The commented v0.1b values below have never been used. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 typedef base::Callback<void(const std::string& web_session_id)> SessionClosedCB; | 118 typedef base::Callback<void(const std::string& web_session_id)> SessionClosedCB; |
| 117 | 119 |
| 118 typedef base::Callback<void(const std::string& web_session_id, | 120 typedef base::Callback<void(const std::string& web_session_id, |
| 119 MediaKeys::Exception exception_code, | 121 MediaKeys::Exception exception_code, |
| 120 uint32 system_code, | 122 uint32 system_code, |
| 121 const std::string& error_message)> SessionErrorCB; | 123 const std::string& error_message)> SessionErrorCB; |
| 122 | 124 |
| 123 } // namespace media | 125 } // namespace media |
| 124 | 126 |
| 125 #endif // MEDIA_BASE_MEDIA_KEYS_H_ | 127 #endif // MEDIA_BASE_MEDIA_KEYS_H_ |
| OLD | NEW |