| 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 "base/memory/scoped_vector.h" |
| 14 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
| 15 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class Time; | 19 class Time; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace media { | 22 namespace media { |
| 22 | 23 |
| 23 class CdmContext; | 24 class CdmContext; |
| 25 struct CdmKeyInformation; |
| 24 | 26 |
| 25 template <typename... T> | 27 template <typename... T> |
| 26 class CdmPromiseTemplate; | 28 class CdmPromiseTemplate; |
| 27 | 29 |
| 28 typedef CdmPromiseTemplate<std::string> NewSessionCdmPromise; | 30 typedef CdmPromiseTemplate<std::string> NewSessionCdmPromise; |
| 29 typedef CdmPromiseTemplate<> SimpleCdmPromise; | 31 typedef CdmPromiseTemplate<> SimpleCdmPromise; |
| 32 typedef ScopedVector<CdmKeyInformation> CdmKeysInfo; |
| 30 | 33 |
| 31 // Performs media key operations. | 34 // Performs media key operations. |
| 32 // | 35 // |
| 33 // All key operations are called on the renderer thread. Therefore, these calls | 36 // All key operations are called on the renderer thread. Therefore, these calls |
| 34 // should be fast and nonblocking; key events should be fired asynchronously. | 37 // should be fast and nonblocking; key events should be fired asynchronously. |
| 35 class MEDIA_EXPORT MediaKeys{ | 38 class MEDIA_EXPORT MediaKeys{ |
| 36 public: | 39 public: |
| 37 // Reported to UMA, so never reuse a value! | 40 // Reported to UMA, so never reuse a value! |
| 38 // Must be kept in sync with blink::WebMediaPlayerClient::MediaKeyErrorCode | 41 // Must be kept in sync with blink::WebMediaPlayerClient::MediaKeyErrorCode |
| 39 // (enforced in webmediaplayer_impl.cc). | 42 // (enforced in webmediaplayer_impl.cc). |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 const GURL& destination_url)> SessionMessageCB; | 132 const GURL& destination_url)> SessionMessageCB; |
| 130 | 133 |
| 131 typedef base::Callback<void(const std::string& web_session_id)> SessionClosedCB; | 134 typedef base::Callback<void(const std::string& web_session_id)> SessionClosedCB; |
| 132 | 135 |
| 133 typedef base::Callback<void(const std::string& web_session_id, | 136 typedef base::Callback<void(const std::string& web_session_id, |
| 134 MediaKeys::Exception exception_code, | 137 MediaKeys::Exception exception_code, |
| 135 uint32 system_code, | 138 uint32 system_code, |
| 136 const std::string& error_message)> SessionErrorCB; | 139 const std::string& error_message)> SessionErrorCB; |
| 137 | 140 |
| 138 typedef base::Callback<void(const std::string& web_session_id, | 141 typedef base::Callback<void(const std::string& web_session_id, |
| 139 bool has_additional_usable_key)> | 142 bool has_additional_usable_key, |
| 140 SessionKeysChangeCB; | 143 CdmKeysInfo keys_info)> SessionKeysChangeCB; |
| 141 | 144 |
| 142 typedef base::Callback<void(const std::string& web_session_id, | 145 typedef base::Callback<void(const std::string& web_session_id, |
| 143 const base::Time& new_expiry_time)> | 146 const base::Time& new_expiry_time)> |
| 144 SessionExpirationUpdateCB; | 147 SessionExpirationUpdateCB; |
| 145 | 148 |
| 146 } // namespace media | 149 } // namespace media |
| 147 | 150 |
| 148 #endif // MEDIA_BASE_MEDIA_KEYS_H_ | 151 #endif // MEDIA_BASE_MEDIA_KEYS_H_ |
| OLD | NEW |