| 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 #if defined(ENABLE_PEPPER_CDMS) |
| 183 RenderCdmFactory cdm_factory( | 184 RenderCdmFactory cdm_factory( |
| 184 #if defined(ENABLE_PEPPER_CDMS) | 185 base::Bind(&PepperCdmWrapperImpl::Create, frame)); |
| 185 base::Bind(&PepperCdmWrapperImpl::Create, frame) | 186 #else |
| 187 RenderCdmFactory cdm_factory; |
| 186 #endif | 188 #endif |
| 187 ); | |
| 188 | 189 |
| 189 if (!proxy_decryptor_->InitializeCDM(&cdm_factory, key_system, | 190 if (!proxy_decryptor_->InitializeCDM(&cdm_factory, key_system, |
| 190 security_origin)) { | 191 security_origin)) { |
| 191 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 192 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
| 192 } | 193 } |
| 193 | 194 |
| 194 if (proxy_decryptor_ && !decryptor_ready_cb_.is_null()) { | 195 if (proxy_decryptor_ && !decryptor_ready_cb_.is_null()) { |
| 195 base::ResetAndReturn(&decryptor_ready_cb_) | 196 base::ResetAndReturn(&decryptor_ready_cb_) |
| 196 .Run(proxy_decryptor_->GetDecryptor(), base::Bind(DoNothing)); | 197 .Run(proxy_decryptor_->GetDecryptor(), base::Bind(DoNothing)); |
| 197 } | 198 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 | 466 |
| 466 if (web_cdm_) { | 467 if (web_cdm_) { |
| 467 decryptor_ready_cb.Run(web_cdm_->GetDecryptor(), base::Bind(DoNothing)); | 468 decryptor_ready_cb.Run(web_cdm_->GetDecryptor(), base::Bind(DoNothing)); |
| 468 return; | 469 return; |
| 469 } | 470 } |
| 470 | 471 |
| 471 decryptor_ready_cb_ = decryptor_ready_cb; | 472 decryptor_ready_cb_ = decryptor_ready_cb; |
| 472 } | 473 } |
| 473 | 474 |
| 474 } // namespace content | 475 } // namespace content |
| OLD | NEW |