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/cdm/render_cdm_factory.h" | 5 #include "content/renderer/media/cdm/render_cdm_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 const media::CdmCreatedCB& cdm_created_cb) { | 52 const media::CdmCreatedCB& cdm_created_cb) { |
53 DCHECK(thread_checker_.CalledOnValidThread()); | 53 DCHECK(thread_checker_.CalledOnValidThread()); |
54 | 54 |
55 if (!security_origin.is_valid()) { | 55 if (!security_origin.is_valid()) { |
56 base::ThreadTaskRunnerHandle::Get()->PostTask( | 56 base::ThreadTaskRunnerHandle::Get()->PostTask( |
57 FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin.")); | 57 FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin.")); |
58 return; | 58 return; |
59 } | 59 } |
60 | 60 |
61 if (media::CanUseAesDecryptor(key_system)) { | 61 if (media::CanUseAesDecryptor(key_system)) { |
62 // TODO(sandersd): Address this now that prefixed EME has been removed. | 62 DCHECK(!cdm_config.allow_distinctive_identifier); |
ddorwin
2016/06/23 01:06:47
We passed `true` from ProxyDecryptor::CreateMediaK
| |
63 // http://crbug.com/249976. The prefixed API always allowed distinctive | 63 DCHECK(!cdm_config.allow_persistent_state); |
64 // identifiers and persistent state. Once that changes we can sanity check | |
65 // here that neither is allowed for AesDecryptor, since it does not support | |
66 // them and should never be configured that way. http://crbug.com/455271 | |
67 scoped_refptr<media::MediaKeys> cdm( | 64 scoped_refptr<media::MediaKeys> cdm( |
68 new media::AesDecryptor(security_origin, session_message_cb, | 65 new media::AesDecryptor(security_origin, session_message_cb, |
69 session_closed_cb, session_keys_change_cb)); | 66 session_closed_cb, session_keys_change_cb)); |
70 base::ThreadTaskRunnerHandle::Get()->PostTask( | 67 base::ThreadTaskRunnerHandle::Get()->PostTask( |
71 FROM_HERE, base::Bind(cdm_created_cb, cdm, "")); | 68 FROM_HERE, base::Bind(cdm_created_cb, cdm, "")); |
72 return; | 69 return; |
73 } | 70 } |
74 | 71 |
75 #if defined(ENABLE_PEPPER_CDMS) | 72 #if defined(ENABLE_PEPPER_CDMS) |
76 DCHECK(!cdm_config.use_hw_secure_codecs); | 73 DCHECK(!cdm_config.use_hw_secure_codecs); |
(...skipping 11 matching lines...) Expand all Loading... | |
88 session_keys_change_cb, session_expiration_update_cb, cdm_created_cb); | 85 session_keys_change_cb, session_expiration_update_cb, cdm_created_cb); |
89 #else | 86 #else |
90 // No possible CDM to create, so fail the request. | 87 // No possible CDM to create, so fail the request. |
91 base::ThreadTaskRunnerHandle::Get()->PostTask( | 88 base::ThreadTaskRunnerHandle::Get()->PostTask( |
92 FROM_HERE, | 89 FROM_HERE, |
93 base::Bind(cdm_created_cb, nullptr, "Key system not supported.")); | 90 base::Bind(cdm_created_cb, nullptr, "Key system not supported.")); |
94 #endif // defined(ENABLE_PEPPER_CDMS) | 91 #endif // defined(ENABLE_PEPPER_CDMS) |
95 } | 92 } |
96 | 93 |
97 } // namespace content | 94 } // namespace content |
OLD | NEW |