| 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 "media/mojo/services/mojo_cdm_service.h" | 5 #include "media/mojo/services/mojo_cdm_service.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 void MojoCdmService::Initialize(const mojo::String& key_system, | 105 void MojoCdmService::Initialize(const mojo::String& key_system, |
| 106 const mojo::String& security_origin, | 106 const mojo::String& security_origin, |
| 107 interfaces::CdmConfigPtr cdm_config, | 107 interfaces::CdmConfigPtr cdm_config, |
| 108 const InitializeCallback& callback) { | 108 const InitializeCallback& callback) { |
| 109 DVLOG(1) << __FUNCTION__ << ": " << key_system; | 109 DVLOG(1) << __FUNCTION__ << ": " << key_system; |
| 110 DCHECK(!cdm_); | 110 DCHECK(!cdm_); |
| 111 | 111 |
| 112 auto weak_this = weak_factory_.GetWeakPtr(); | 112 auto weak_this = weak_factory_.GetWeakPtr(); |
| 113 cdm_factory_->Create( | 113 cdm_factory_->Create( |
| 114 key_system, GURL(security_origin), cdm_config.To<CdmConfig>(), | 114 key_system, GURL(security_origin.get()), cdm_config.To<CdmConfig>(), |
| 115 base::Bind(&MojoCdmService::OnSessionMessage, weak_this), | 115 base::Bind(&MojoCdmService::OnSessionMessage, weak_this), |
| 116 base::Bind(&MojoCdmService::OnSessionClosed, weak_this), | 116 base::Bind(&MojoCdmService::OnSessionClosed, weak_this), |
| 117 base::Bind(&MojoCdmService::OnLegacySessionError, weak_this), | 117 base::Bind(&MojoCdmService::OnLegacySessionError, weak_this), |
| 118 base::Bind(&MojoCdmService::OnSessionKeysChange, weak_this), | 118 base::Bind(&MojoCdmService::OnSessionKeysChange, weak_this), |
| 119 base::Bind(&MojoCdmService::OnSessionExpirationUpdate, weak_this), | 119 base::Bind(&MojoCdmService::OnSessionExpirationUpdate, weak_this), |
| 120 base::Bind(&MojoCdmService::OnCdmCreated, weak_this, callback)); | 120 base::Bind(&MojoCdmService::OnCdmCreated, weak_this, callback)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void MojoCdmService::SetServerCertificate( | 123 void MojoCdmService::SetServerCertificate( |
| 124 mojo::Array<uint8_t> certificate_data, | 124 mojo::Array<uint8_t> certificate_data, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 void MojoCdmService::OnDecryptorConnectionError() { | 275 void MojoCdmService::OnDecryptorConnectionError() { |
| 276 DVLOG(2) << __FUNCTION__; | 276 DVLOG(2) << __FUNCTION__; |
| 277 | 277 |
| 278 // MojoDecryptorService has lost connectivity to it's client, so it can be | 278 // MojoDecryptorService has lost connectivity to it's client, so it can be |
| 279 // freed. | 279 // freed. |
| 280 decryptor_.reset(); | 280 decryptor_.reset(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace media | 283 } // namespace media |
| OLD | NEW |