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..9d8224133b5abeb8604081018f668690d58705fc |
--- /dev/null |
+++ b/media/mojo/services/mojo_cdm_factory_service.cc |
@@ -0,0 +1,38 @@ |
+// 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, |
+ mojo::InterfaceRequest<mojo::ContentDecryptionModuleFactory> request) |
+ : binding_(this, request.Pass()), 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> request) { |
+ DVLOG(1) << __FUNCTION__ << ": " << key_system; |
+ // TODO(xhwang): Drop the return value. |
+ MojoCdmService* cdm_service = |
+ context_->Create(key_system, security_origin, cdm_id, request.Pass()); |
+ |
+ if (!cdm_service) { |
+ LOG(ERROR) << "MojoCdmService cannot be created."; |
+ return; |
+ } |
+} |
+ |
+} // namespace media |