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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "media/base/cdm_key_information.h" | 8 #include "media/base/cdm_key_information.h" |
9 #include "media/base/key_systems.h" | 9 #include "media/base/key_systems.h" |
10 #include "media/cdm/aes_decryptor.h" | 10 #include "media/cdm/aes_decryptor.h" |
11 #include "media/mojo/services/media_type_converters.h" | 11 #include "media/mojo/services/media_type_converters.h" |
12 #include "media/mojo/services/mojo_cdm_promise.h" | 12 #include "media/mojo/services/mojo_cdm_promise.h" |
13 #include "media/mojo/services/mojo_cdm_service_context.h" | 13 #include "media/mojo/services/mojo_cdm_service_context.h" |
14 #include "mojo/common/common_type_converters.h" | 14 #include "mojo/common/common_type_converters.h" |
15 #include "mojo/common/url_type_converters.h" | 15 #include "mojo/common/url_type_converters.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace media { | 18 namespace media { |
19 | 19 |
20 typedef MojoCdmPromise<> SimpleMojoCdmPromise; | 20 typedef MojoCdmPromise<> SimpleMojoCdmPromise; |
21 typedef MojoCdmPromise<std::string> NewSessionMojoCdmPromise; | 21 typedef MojoCdmPromise<std::string> NewSessionMojoCdmPromise; |
22 | 22 |
23 MojoCdmService::MojoCdmService( | 23 MojoCdmService::MojoCdmService( |
24 MojoCdmServiceContext* context, | 24 MojoCdmServiceContext* context, |
| 25 mojo::ServiceProvider* service_provider, |
25 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request) | 26 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request) |
26 : binding_(this, request.Pass()), | 27 : binding_(this, request.Pass()), |
27 context_(context), | 28 context_(context), |
| 29 service_provider_(service_provider), |
28 cdm_id_(CdmContext::kInvalidCdmId), | 30 cdm_id_(CdmContext::kInvalidCdmId), |
29 weak_factory_(this) { | 31 weak_factory_(this) { |
30 DVLOG(1) << __FUNCTION__; | 32 DVLOG(1) << __FUNCTION__; |
31 } | 33 } |
32 | 34 |
33 MojoCdmService::~MojoCdmService() { | 35 MojoCdmService::~MojoCdmService() { |
34 DVLOG(1) << __FUNCTION__; | 36 DVLOG(1) << __FUNCTION__; |
35 if (cdm_id_ != CdmContext::kInvalidCdmId) | 37 if (cdm_id_ != CdmContext::kInvalidCdmId) |
36 context_->UnregisterCdm(cdm_id_); | 38 context_->UnregisterCdm(cdm_id_); |
37 } | 39 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 MediaKeys::Exception exception, | 186 MediaKeys::Exception exception, |
185 uint32_t system_code, | 187 uint32_t system_code, |
186 const std::string& error_message) { | 188 const std::string& error_message) { |
187 DVLOG(2) << __FUNCTION__; | 189 DVLOG(2) << __FUNCTION__; |
188 client_->OnLegacySessionError(session_id, | 190 client_->OnLegacySessionError(session_id, |
189 static_cast<mojo::CdmException>(exception), | 191 static_cast<mojo::CdmException>(exception), |
190 system_code, error_message); | 192 system_code, error_message); |
191 } | 193 } |
192 | 194 |
193 } // namespace media | 195 } // namespace media |
OLD | NEW |