Chromium Code Reviews| 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 #include "content/renderer/media/crypto/render_cdm_factory.h" | 5 #include "content/renderer/media/crypto/render_cdm_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "media/base/key_systems.h" | 8 #include "media/base/key_systems.h" |
| 9 #include "media/cdm/aes_decryptor.h" | 9 #include "media/cdm/aes_decryptor.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 #else | 29 #else |
| 30 RenderCdmFactory::RenderCdmFactory() { | 30 RenderCdmFactory::RenderCdmFactory() { |
| 31 } | 31 } |
| 32 #endif // defined(ENABLE_PEPPER_CDMS) | 32 #endif // defined(ENABLE_PEPPER_CDMS) |
| 33 | 33 |
| 34 RenderCdmFactory::~RenderCdmFactory() { | 34 RenderCdmFactory::~RenderCdmFactory() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 scoped_ptr<media::MediaKeys> RenderCdmFactory::Create( | 37 scoped_ptr<media::MediaKeys> RenderCdmFactory::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 media::SessionMessageCB& session_message_cb, | 42 const media::SessionMessageCB& session_message_cb, |
| 41 const media::SessionClosedCB& session_closed_cb, | 43 const media::SessionClosedCB& session_closed_cb, |
| 42 const media::SessionErrorCB& session_error_cb, | 44 const media::SessionErrorCB& session_error_cb, |
| 43 const media::SessionKeysChangeCB& session_keys_change_cb, | 45 const media::SessionKeysChangeCB& session_keys_change_cb, |
| 44 const media::SessionExpirationUpdateCB& session_expiration_update_cb) { | 46 const media::SessionExpirationUpdateCB& session_expiration_update_cb) { |
| 45 // TODO(jrummell): Pass |security_origin| to all constructors. | 47 // TODO(jrummell): Pass |security_origin| to all constructors. |
|
ddorwin
2015/03/06 21:42:54
Regarding a Params object, that would make it hard
sandersd (OOO until July 31)
2015/03/06 22:36:58
Acknowledged.
| |
| 46 // TODO(jrummell): Enable the following line once blink code updated to | 48 // TODO(jrummell): Enable the following line once blink code updated to |
| 47 // check the security origin before calling. | 49 // check the security origin before calling. |
| 48 // DCHECK(security_origin.is_valid()); | 50 // DCHECK(security_origin.is_valid()); |
| 49 | 51 |
| 50 if (media::CanUseAesDecryptor(key_system)) { | 52 if (media::CanUseAesDecryptor(key_system)) { |
| 51 return scoped_ptr<media::MediaKeys>(new media::AesDecryptor( | 53 return scoped_ptr<media::MediaKeys>(new media::AesDecryptor( |
|
ddorwin
2015/03/06 21:42:54
DCHECK here or pass in. Passing would abstract whe
sandersd (OOO until July 31)
2015/03/06 22:36:58
Done.
| |
| 52 session_message_cb, session_closed_cb, session_keys_change_cb)); | 54 session_message_cb, session_closed_cb, session_keys_change_cb)); |
| 53 } | 55 } |
| 54 | 56 |
| 55 #if defined(ENABLE_PEPPER_CDMS) | 57 #if defined(ENABLE_PEPPER_CDMS) |
| 56 return scoped_ptr<media::MediaKeys>( | 58 return scoped_ptr<media::MediaKeys>( |
| 57 PpapiDecryptor::Create(key_system, | 59 PpapiDecryptor::Create(key_system, |
| 60 allow_distinctive_identifier, | |
| 61 allow_persistent_state, | |
| 58 security_origin, | 62 security_origin, |
| 59 create_pepper_cdm_cb_, | 63 create_pepper_cdm_cb_, |
| 60 session_message_cb, | 64 session_message_cb, |
| 61 session_closed_cb, | 65 session_closed_cb, |
| 62 session_error_cb, | 66 session_error_cb, |
| 63 session_keys_change_cb, | 67 session_keys_change_cb, |
| 64 session_expiration_update_cb)); | 68 session_expiration_update_cb)); |
| 65 #elif defined(ENABLE_BROWSER_CDMS) | 69 #elif defined(ENABLE_BROWSER_CDMS) |
| 70 DCHECK(allow_distinctive_identifier); | |
| 71 DCHECK(allow_persistent_state); | |
| 66 return scoped_ptr<media::MediaKeys>( | 72 return scoped_ptr<media::MediaKeys>( |
| 67 ProxyMediaKeys::Create(key_system, | 73 ProxyMediaKeys::Create(key_system, |
| 68 security_origin, | 74 security_origin, |
| 69 manager_, | 75 manager_, |
| 70 session_message_cb, | 76 session_message_cb, |
| 71 session_closed_cb, | 77 session_closed_cb, |
| 72 session_error_cb, | 78 session_error_cb, |
| 73 session_keys_change_cb, | 79 session_keys_change_cb, |
| 74 session_expiration_update_cb)); | 80 session_expiration_update_cb)); |
| 75 #else | 81 #else |
| 76 return nullptr; | 82 return nullptr; |
| 77 #endif // defined(ENABLE_PEPPER_CDMS) | 83 #endif // defined(ENABLE_PEPPER_CDMS) |
| 78 } | 84 } |
| 79 | 85 |
| 80 } // namespace content | 86 } // namespace content |
| OLD | NEW |