OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "media/mojo/services/mojo_cdm_factory_service.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "media/mojo/services/mojo_cdm_service_context.h" |
| 9 |
| 10 namespace media { |
| 11 |
| 12 MojoCdmFactoryService::MojoCdmFactoryService( |
| 13 MojoCdmServiceContext* context, |
| 14 mojo::InterfaceRequest<mojo::ContentDecryptionModuleFactory> request) |
| 15 : binding_(this, request.Pass()), context_(context) { |
| 16 DCHECK(context_); |
| 17 } |
| 18 |
| 19 MojoCdmFactoryService::~MojoCdmFactoryService() { |
| 20 } |
| 21 |
| 22 void MojoCdmFactoryService::Create( |
| 23 const mojo::String& key_system, |
| 24 const mojo::String& security_origin, |
| 25 int32_t cdm_id, |
| 26 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request) { |
| 27 DVLOG(1) << __FUNCTION__ << ": " << key_system; |
| 28 // TODO(xhwang): Drop the return value. |
| 29 MojoCdmService* cdm_service = |
| 30 context_->Create(key_system, security_origin, cdm_id, request.Pass()); |
| 31 |
| 32 if (!cdm_service) { |
| 33 LOG(ERROR) << "MojoCdmService cannot be created."; |
| 34 return; |
| 35 } |
| 36 } |
| 37 |
| 38 } // namespace media |
OLD | NEW |