Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "media/mojo/clients/mojo_cdm_factory.h" | 5 #include "media/mojo/clients/mojo_cdm_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 return; | 41 return; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // When MojoRenderer is used, the real Renderer is running in a remote process, | 44 // When MojoRenderer is used, the real Renderer is running in a remote process, |
| 45 // which cannot use an AesDecryptor running locally. In this case, always | 45 // which cannot use an AesDecryptor running locally. In this case, always |
| 46 // create the MojoCdm, giving the remote CDM a chance to handle |key_system|. | 46 // create the MojoCdm, giving the remote CDM a chance to handle |key_system|. |
| 47 // Note: We should not run AesDecryptor in the browser process except for | 47 // Note: We should not run AesDecryptor in the browser process except for |
| 48 // testing. See http://crbug.com/441957 | 48 // testing. See http://crbug.com/441957 |
| 49 #if !defined(ENABLE_MOJO_RENDERER) | 49 #if !defined(ENABLE_MOJO_RENDERER) |
| 50 if (CanUseAesDecryptor(key_system)) { | 50 if (CanUseAesDecryptor(key_system)) { |
| 51 scoped_refptr<MediaKeys> cdm( | 51 scoped_refptr<ContentDecryptionModule> cdm( |
|
jrummell
2016/12/12 22:08:40
nit: Should probably include content_decryption_mo
xhwang
2016/12/12 22:32:51
Done.
| |
| 52 new AesDecryptor(security_origin, session_message_cb, session_closed_cb, | 52 new AesDecryptor(security_origin, session_message_cb, session_closed_cb, |
| 53 session_keys_change_cb)); | 53 session_keys_change_cb)); |
| 54 base::ThreadTaskRunnerHandle::Get()->PostTask( | 54 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 55 FROM_HERE, base::Bind(cdm_created_cb, cdm, "")); | 55 FROM_HERE, base::Bind(cdm_created_cb, cdm, "")); |
| 56 return; | 56 return; |
| 57 } | 57 } |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 mojom::ContentDecryptionModulePtr cdm_ptr; | 60 mojom::ContentDecryptionModulePtr cdm_ptr; |
| 61 service_manager::GetInterface<mojom::ContentDecryptionModule>( | 61 service_manager::GetInterface<mojom::ContentDecryptionModule>( |
| 62 interface_provider_, &cdm_ptr); | 62 interface_provider_, &cdm_ptr); |
| 63 | 63 |
| 64 MojoCdm::Create(key_system, security_origin, cdm_config, std::move(cdm_ptr), | 64 MojoCdm::Create(key_system, security_origin, cdm_config, std::move(cdm_ptr), |
| 65 session_message_cb, session_closed_cb, session_keys_change_cb, | 65 session_message_cb, session_closed_cb, session_keys_change_cb, |
| 66 session_expiration_update_cb, cdm_created_cb); | 66 session_expiration_update_cb, cdm_created_cb); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace media | 69 } // namespace media |
| OLD | NEW |