| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 const scoped_refptr<MediaKeys>& cdm, | 189 const scoped_refptr<MediaKeys>& cdm, |
| 190 const std::string& error_message) { | 190 const std::string& error_message) { |
| 191 interfaces::CdmPromiseResultPtr cdm_promise_result( | 191 interfaces::CdmPromiseResultPtr cdm_promise_result( |
| 192 interfaces::CdmPromiseResult::New()); | 192 interfaces::CdmPromiseResult::New()); |
| 193 | 193 |
| 194 // TODO(xhwang): This should not happen when KeySystemInfo is properly | 194 // TODO(xhwang): This should not happen when KeySystemInfo is properly |
| 195 // populated. See http://crbug.com/469366 | 195 // populated. See http://crbug.com/469366 |
| 196 if (!cdm || !context_) { | 196 if (!cdm || !context_) { |
| 197 cdm_promise_result->success = false; | 197 cdm_promise_result->success = false; |
| 198 cdm_promise_result->exception = | 198 cdm_promise_result->exception = |
| 199 interfaces::CDM_EXCEPTION_NOT_SUPPORTED_ERROR; | 199 interfaces::CdmException::NOT_SUPPORTED_ERROR; |
| 200 cdm_promise_result->system_code = 0; | 200 cdm_promise_result->system_code = 0; |
| 201 cdm_promise_result->error_message = error_message; | 201 cdm_promise_result->error_message = error_message; |
| 202 callback.Run(std::move(cdm_promise_result), 0, nullptr); | 202 callback.Run(std::move(cdm_promise_result), 0, nullptr); |
| 203 return; | 203 return; |
| 204 } | 204 } |
| 205 | 205 |
| 206 cdm_ = cdm; | 206 cdm_ = cdm; |
| 207 cdm_id_ = next_cdm_id_++; | 207 cdm_id_ = next_cdm_id_++; |
| 208 | 208 |
| 209 context_->RegisterCdm(cdm_id_, this); | 209 context_->RegisterCdm(cdm_id_, this); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 void MojoCdmService::OnDecryptorConnectionError() { | 277 void MojoCdmService::OnDecryptorConnectionError() { |
| 278 DVLOG(2) << __FUNCTION__; | 278 DVLOG(2) << __FUNCTION__; |
| 279 | 279 |
| 280 // MojoDecryptorService has lost connectivity to it's client, so it can be | 280 // MojoDecryptorService has lost connectivity to it's client, so it can be |
| 281 // freed. | 281 // freed. |
| 282 decryptor_.reset(); | 282 decryptor_.reset(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace media | 285 } // namespace media |
| OLD | NEW |