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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 const scoped_refptr<MediaKeys>& cdm, | 187 const scoped_refptr<MediaKeys>& cdm, |
188 const std::string& error_message) { | 188 const std::string& error_message) { |
189 interfaces::CdmPromiseResultPtr cdm_promise_result( | 189 interfaces::CdmPromiseResultPtr cdm_promise_result( |
190 interfaces::CdmPromiseResult::New()); | 190 interfaces::CdmPromiseResult::New()); |
191 | 191 |
192 // TODO(xhwang): This should not happen when KeySystemInfo is properly | 192 // TODO(xhwang): This should not happen when KeySystemInfo is properly |
193 // populated. See http://crbug.com/469366 | 193 // populated. See http://crbug.com/469366 |
194 if (!cdm || !context_) { | 194 if (!cdm || !context_) { |
195 cdm_promise_result->success = false; | 195 cdm_promise_result->success = false; |
196 cdm_promise_result->exception = | 196 cdm_promise_result->exception = |
197 interfaces::CDM_EXCEPTION_NOT_SUPPORTED_ERROR; | 197 interfaces::CdmException::NOT_SUPPORTED_ERROR; |
198 cdm_promise_result->system_code = 0; | 198 cdm_promise_result->system_code = 0; |
199 cdm_promise_result->error_message = error_message; | 199 cdm_promise_result->error_message = error_message; |
200 callback.Run(std::move(cdm_promise_result), 0, nullptr); | 200 callback.Run(std::move(cdm_promise_result), 0, nullptr); |
201 return; | 201 return; |
202 } | 202 } |
203 | 203 |
204 cdm_ = cdm; | 204 cdm_ = cdm; |
205 cdm_id_ = next_cdm_id_++; | 205 cdm_id_ = next_cdm_id_++; |
206 | 206 |
207 context_->RegisterCdm(cdm_id_, this); | 207 context_->RegisterCdm(cdm_id_, this); |
(...skipping 66 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 |