OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/encrypted_media_player_support_impl.h" | 5 #include "content/renderer/media/crypto/encrypted_media_player_support_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 if (current_key_system_.empty()) { | 173 if (current_key_system_.empty()) { |
174 if (!proxy_decryptor_) { | 174 if (!proxy_decryptor_) { |
175 proxy_decryptor_.reset(new ProxyDecryptor( | 175 proxy_decryptor_.reset(new ProxyDecryptor( |
176 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupportImpl::OnKeyAdded), | 176 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupportImpl::OnKeyAdded), |
177 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupportImpl::OnKeyError), | 177 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupportImpl::OnKeyError), |
178 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupportImpl::OnKeyMessage))); | 178 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupportImpl::OnKeyMessage))); |
179 } | 179 } |
180 | 180 |
181 GURL security_origin(frame->document().securityOrigin().toString()); | 181 GURL security_origin(frame->document().securityOrigin().toString()); |
182 | 182 |
183 RenderCdmFactory cdm_factory( | 183 RenderCdmFactory cdm_factory |
184 #if defined(ENABLE_PEPPER_CDMS) | 184 #if defined(ENABLE_PEPPER_CDMS) |
185 base::Bind(&PepperCdmWrapperImpl::Create, frame) | 185 (base::Bind(&PepperCdmWrapperImpl::Create, frame)) |
jamesr
2014/10/21 00:43:38
at this point sharing the variable declaration isn
gunsch
2014/10/21 00:50:28
Done.
| |
186 #endif | 186 #endif |
187 ); | 187 ; |
188 | 188 |
189 if (!proxy_decryptor_->InitializeCDM(&cdm_factory, key_system, | 189 if (!proxy_decryptor_->InitializeCDM(&cdm_factory, key_system, |
190 security_origin)) { | 190 security_origin)) { |
191 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 191 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
192 } | 192 } |
193 | 193 |
194 if (proxy_decryptor_ && !decryptor_ready_cb_.is_null()) { | 194 if (proxy_decryptor_ && !decryptor_ready_cb_.is_null()) { |
195 base::ResetAndReturn(&decryptor_ready_cb_) | 195 base::ResetAndReturn(&decryptor_ready_cb_) |
196 .Run(proxy_decryptor_->GetDecryptor(), base::Bind(DoNothing)); | 196 .Run(proxy_decryptor_->GetDecryptor(), base::Bind(DoNothing)); |
197 } | 197 } |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 | 465 |
466 if (web_cdm_) { | 466 if (web_cdm_) { |
467 decryptor_ready_cb.Run(web_cdm_->GetDecryptor(), base::Bind(DoNothing)); | 467 decryptor_ready_cb.Run(web_cdm_->GetDecryptor(), base::Bind(DoNothing)); |
468 return; | 468 return; |
469 } | 469 } |
470 | 470 |
471 decryptor_ready_cb_ = decryptor_ready_cb; | 471 decryptor_ready_cb_ = decryptor_ready_cb; |
472 } | 472 } |
473 | 473 |
474 } // namespace content | 474 } // namespace content |
OLD | NEW |