| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 const uint8* init_data, int init_data_length); | 44 const uint8* init_data, int init_data_length); |
| 45 void AddKey(const std::string& key_system, | 45 void AddKey(const std::string& key_system, |
| 46 const uint8* key, int key_length, | 46 const uint8* key, int key_length, |
| 47 const uint8* init_data, int init_data_length, | 47 const uint8* init_data, int init_data_length, |
| 48 const std::string& session_id); | 48 const std::string& session_id); |
| 49 void CancelKeyRequest(const std::string& key_system, | 49 void CancelKeyRequest(const std::string& key_system, |
| 50 const std::string& session_id); | 50 const std::string& session_id); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 // Helper functions to create decryptors to handle the given |key_system|. | 53 // Helper functions to create decryptors to handle the given |key_system|. |
| 54 #if defined(ENABLE_PEPPER_CDMS) |
| 54 scoped_ptr<media::Decryptor> CreatePpapiDecryptor( | 55 scoped_ptr<media::Decryptor> CreatePpapiDecryptor( |
| 55 const std::string& key_system); | 56 const std::string& key_system); |
| 57 #endif // defined(ENABLE_PEPPER_CDMS) |
| 56 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system); | 58 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system); |
| 57 | 59 |
| 58 // Callbacks for firing key events. | 60 // Callbacks for firing key events. |
| 59 void KeyAdded(const std::string& key_system, const std::string& session_id); | 61 void KeyAdded(const std::string& key_system, const std::string& session_id); |
| 60 void KeyError(const std::string& key_system, | 62 void KeyError(const std::string& key_system, |
| 61 const std::string& session_id, | 63 const std::string& session_id, |
| 62 media::Decryptor::KeyError error_code, | 64 media::Decryptor::KeyError error_code, |
| 63 int system_code); | 65 int system_code); |
| 64 void KeyMessage(const std::string& key_system, | 66 void KeyMessage(const std::string& key_system, |
| 65 const std::string& session_id, | 67 const std::string& session_id, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 92 scoped_ptr<media::Decryptor> decryptor_; | 94 scoped_ptr<media::Decryptor> decryptor_; |
| 93 | 95 |
| 94 base::WeakPtrFactory<ProxyDecryptor> weak_ptr_factory_; | 96 base::WeakPtrFactory<ProxyDecryptor> weak_ptr_factory_; |
| 95 | 97 |
| 96 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); | 98 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); |
| 97 }; | 99 }; |
| 98 | 100 |
| 99 } // namespace webkit_media | 101 } // namespace webkit_media |
| 100 | 102 |
| 101 #endif // WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 103 #endif // WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
| OLD | NEW |