| 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 | 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 // Performs media key operations. | 17 // Performs media key operations. |
| 18 // | 18 // |
| 19 // All key operations are called on the renderer thread. Therefore, these calls | 19 // All key operations are called on the renderer thread. Therefore, these calls |
| 20 // should be fast and nonblocking; key events should be fired asynchronously. | 20 // should be fast and nonblocking; key events should be fired asynchronously. |
| 21 class MEDIA_EXPORT MediaKeys { | 21 class MEDIA_EXPORT MediaKeys { |
| 22 public: | 22 public: |
| 23 // Reported to UMA, so never reuse a value! | 23 // Reported to UMA, so never reuse a value! |
| 24 // Must be kept in sync with WebKit::WebMediaPlayerClient::MediaKeyErrorCode | 24 // Must be kept in sync with WebKit::WebMediaPlayerClient::MediaKeyErrorCode |
| 25 // (enforced in webmediaplayer_impl.cc). | 25 // (enforced in webmediaplayer_impl.cc). |
| 26 enum KeyError { | 26 enum KeyError { |
| 27 kUnknownError = 1, | 27 kUnknownError = 1, |
| 28 kClientError, | 28 kClientError, |
| 29 kServiceError, | 29 // The following v0.1b values have never been used. |
| 30 kOutputError, | 30 // kServiceError, |
| 31 kHardwareChangeError, | 31 // kOutputError, |
| 32 kDomainError, | 32 // kHardwareChangeError, |
| 33 // kDomainError, |
| 33 kMaxKeyError // Must be last and greater than any legit value. | 34 kMaxKeyError // Must be last and greater than any legit value. |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 MediaKeys(); | 37 MediaKeys(); |
| 37 virtual ~MediaKeys(); | 38 virtual ~MediaKeys(); |
| 38 | 39 |
| 39 // Generates a key request for the |key_system| with |type| and | 40 // Generates a key request for the |key_system| with |type| and |
| 40 // |init_data| provided. | 41 // |init_data| provided. |
| 41 // Returns true if generating key request succeeded, false otherwise. | 42 // Returns true if generating key request succeeded, false otherwise. |
| 42 // Note: AddKey() and CancelKeyRequest() should only be called after | 43 // Note: AddKey() and CancelKeyRequest() should only be called after |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 typedef base::Callback<void(const std::string& key_system, | 82 typedef base::Callback<void(const std::string& key_system, |
| 82 const std::string& session_id, | 83 const std::string& session_id, |
| 83 const std::string& type, | 84 const std::string& type, |
| 84 scoped_ptr<uint8[]> init_data, | 85 scoped_ptr<uint8[]> init_data, |
| 85 int init_data_size)> NeedKeyCB; | 86 int init_data_size)> NeedKeyCB; |
| 86 | 87 |
| 87 } // namespace media | 88 } // namespace media |
| 88 | 89 |
| 89 #endif // MEDIA_BASE_MEDIA_KEYS_H_ | 90 #endif // MEDIA_BASE_MEDIA_KEYS_H_ |
| OLD | NEW |