| 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 CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // PpapiDecryptor implements media::MediaKeys and media::Decryptor and forwards | 30 // PpapiDecryptor implements media::MediaKeys and media::Decryptor and forwards |
| 31 // all calls to the PluginInstance. | 31 // all calls to the PluginInstance. |
| 32 // This class should always be created & destroyed on the main renderer thread. | 32 // This class should always be created & destroyed on the main renderer thread. |
| 33 class PpapiDecryptor : public media::MediaKeys, | 33 class PpapiDecryptor : public media::MediaKeys, |
| 34 public media::CdmContext, | 34 public media::CdmContext, |
| 35 public media::Decryptor { | 35 public media::Decryptor { |
| 36 public: | 36 public: |
| 37 static scoped_ptr<PpapiDecryptor> Create( | 37 static scoped_ptr<PpapiDecryptor> Create( |
| 38 const std::string& key_system, | 38 const std::string& key_system, |
| 39 bool allow_distinctive_identifier, |
| 40 bool allow_persistent_state, |
| 39 const GURL& security_origin, | 41 const GURL& security_origin, |
| 40 const CreatePepperCdmCB& create_pepper_cdm_cb, | 42 const CreatePepperCdmCB& create_pepper_cdm_cb, |
| 41 const media::SessionMessageCB& session_message_cb, | 43 const media::SessionMessageCB& session_message_cb, |
| 42 const media::SessionClosedCB& session_closed_cb, | 44 const media::SessionClosedCB& session_closed_cb, |
| 43 const media::SessionErrorCB& session_error_cb, | 45 const media::SessionErrorCB& session_error_cb, |
| 44 const media::SessionKeysChangeCB& session_keys_change_cb, | 46 const media::SessionKeysChangeCB& session_keys_change_cb, |
| 45 const media::SessionExpirationUpdateCB& session_expiration_update_cb); | 47 const media::SessionExpirationUpdateCB& session_expiration_update_cb); |
| 46 | 48 |
| 47 ~PpapiDecryptor() override; | 49 ~PpapiDecryptor() override; |
| 48 | 50 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const AudioDecodeCB& audio_decode_cb) override; | 91 const AudioDecodeCB& audio_decode_cb) override; |
| 90 void DecryptAndDecodeVideo( | 92 void DecryptAndDecodeVideo( |
| 91 const scoped_refptr<media::DecoderBuffer>& encrypted, | 93 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 92 const VideoDecodeCB& video_decode_cb) override; | 94 const VideoDecodeCB& video_decode_cb) override; |
| 93 void ResetDecoder(StreamType stream_type) override; | 95 void ResetDecoder(StreamType stream_type) override; |
| 94 void DeinitializeDecoder(StreamType stream_type) override; | 96 void DeinitializeDecoder(StreamType stream_type) override; |
| 95 | 97 |
| 96 private: | 98 private: |
| 97 PpapiDecryptor( | 99 PpapiDecryptor( |
| 98 const std::string& key_system, | 100 const std::string& key_system, |
| 101 bool allow_distinctive_identifier, |
| 102 bool allow_persistent_state, |
| 99 scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper, | 103 scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper, |
| 100 const media::SessionMessageCB& session_message_cb, | 104 const media::SessionMessageCB& session_message_cb, |
| 101 const media::SessionClosedCB& session_closed_cb, | 105 const media::SessionClosedCB& session_closed_cb, |
| 102 const media::SessionErrorCB& session_error_cb, | 106 const media::SessionErrorCB& session_error_cb, |
| 103 const media::SessionKeysChangeCB& session_keys_change_cb, | 107 const media::SessionKeysChangeCB& session_keys_change_cb, |
| 104 const media::SessionExpirationUpdateCB& session_expiration_update_cb); | 108 const media::SessionExpirationUpdateCB& session_expiration_update_cb); |
| 105 | 109 |
| 106 void OnDecoderInitialized(StreamType stream_type, bool success); | 110 void OnDecoderInitialized(StreamType stream_type, bool success); |
| 107 | 111 |
| 108 // Callbacks for |plugin_cdm_delegate_| to fire session events. | 112 // Callbacks for |plugin_cdm_delegate_| to fire session events. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 154 |
| 151 // NOTE: Weak pointers must be invalidated before all other member variables. | 155 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 152 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; | 156 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; |
| 153 | 157 |
| 154 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); | 158 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
| 155 }; | 159 }; |
| 156 | 160 |
| 157 } // namespace content | 161 } // namespace content |
| 158 | 162 |
| 159 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 163 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| OLD | NEW |