| Index: webkit/media/crypto/ppapi/cdm_wrapper.cc
|
| diff --git a/webkit/media/crypto/ppapi/cdm_wrapper.cc b/webkit/media/crypto/ppapi/cdm_wrapper.cc
|
| index 4385f51f1356786f9d2d5396bb70a3164ee09673..facb9267e9087aa1a5546fa48adfa197b553ca47 100644
|
| --- a/webkit/media/crypto/ppapi/cdm_wrapper.cc
|
| +++ b/webkit/media/crypto/ppapi/cdm_wrapper.cc
|
| @@ -478,6 +478,7 @@ class AudioFramesImpl : public cdm::AudioFrames {
|
| // Content Decryption Module (CDM).
|
| class CdmWrapper : public pp::Instance,
|
| public pp::ContentDecryptor_Private,
|
| + public cdm::HostFactory,
|
| public cdm::Host {
|
| public:
|
| CdmWrapper(PP_Instance instance, pp::Module* module);
|
| @@ -516,6 +517,9 @@ class CdmWrapper : public pp::Instance,
|
| pp::Buffer_Dev encrypted_buffer,
|
| const PP_EncryptedBlockInfo& encrypted_block_info) OVERRIDE;
|
|
|
| + // cdm::HostFactory implementation.
|
| + virtual void* GetCdmHost(const char* host_version) OVERRIDE;
|
| +
|
| // cdm::Host implementation.
|
| virtual void SetTimer(int64_t delay_ms, void* context) OVERRIDE;
|
| virtual double GetCurrentWallTimeInSeconds() OVERRIDE;
|
| @@ -527,6 +531,8 @@ class CdmWrapper : public pp::Instance,
|
| int32_t session_id_length,
|
| cdm::MediaKeyError error_code,
|
| uint32_t system_code) OVERRIDE;
|
| + virtual void GetPrivateData(int32_t* instance,
|
| + GetPrivateInterface* get_interface) OVERRIDE;
|
|
|
| private:
|
| struct SessionInfo {
|
| @@ -859,6 +865,12 @@ void CdmWrapper::DecryptAndDecode(
|
| }
|
| }
|
|
|
| +void* CdmWrapper::GetCdmHost(const char* host_version) {
|
| + if (strcmp(host_version, CDM_HOST_INTERFACE) == 0)
|
| + return static_cast<cdm::Host*>(this);
|
| + return NULL;
|
| +}
|
| +
|
| void CdmWrapper::SetTimer(int64_t delay_ms, void* context) {
|
| // NOTE: doesn't really need to run on the main thread; could just as well run
|
| // on a helper thread if |cdm_| were thread-friendly and care was taken. We
|
| @@ -901,12 +913,17 @@ void CdmWrapper::SendKeyError(const char* session_id,
|
| system_code);
|
| }
|
|
|
| +void CdmWrapper::GetPrivateData(int32_t* instance,
|
| + cdm::Host::GetPrivateInterface* get_interface) {
|
| + *instance = pp_instance();
|
| + *get_interface = pp::Module::Get()->get_browser_interface();
|
| +}
|
| +
|
| void CdmWrapper::SendUnknownKeyError(const std::string& key_system,
|
| const std::string& session_id) {
|
| SendKeyErrorInternal(key_system, session_id, cdm::kUnknownError, 0);
|
| }
|
|
|
| -
|
| void CdmWrapper::SendKeyAdded(const std::string& key_system,
|
| const std::string& session_id) {
|
| PostOnMain(callback_factory_.NewCallback(
|
|
|