| Index: media/mojo/services/mojo_cdm_factory_service.cc
|
| diff --git a/media/mojo/services/mojo_cdm_factory_service.cc b/media/mojo/services/mojo_cdm_factory_service.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..690d18bdc8a7d78702ff8597b522aefc308f76d0
|
| --- /dev/null
|
| +++ b/media/mojo/services/mojo_cdm_factory_service.cc
|
| @@ -0,0 +1,37 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "media/mojo/services/mojo_cdm_factory_service.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "media/mojo/services/mojo_cdm_service_context.h"
|
| +
|
| +namespace media {
|
| +
|
| +MojoCdmFactoryService::MojoCdmFactoryService(MojoCdmServiceContext* context)
|
| + : context_(context) {
|
| + DCHECK(context_);
|
| +}
|
| +
|
| +MojoCdmFactoryService::~MojoCdmFactoryService() {
|
| +}
|
| +
|
| +void MojoCdmFactoryService::Create(
|
| + const mojo::String& key_system,
|
| + const mojo::String& security_origin,
|
| + int32_t cdm_id,
|
| + mojo::InterfaceRequest<mojo::ContentDecryptionModule> cdm) {
|
| + DVLOG(1) << __FUNCTION__ << ": " << key_system;
|
| + MojoCdmService* cdm_service =
|
| + context_->Create(key_system, security_origin, cdm_id);
|
| +
|
| + if (!cdm_service) {
|
| + LOG(ERROR) << "MojoCdmService cannot be created.";
|
| + return;
|
| + }
|
| +
|
| + mojo::WeakBindToRequest(cdm_service, &cdm);
|
| +}
|
| +
|
| +} // namespace media
|
|
|