| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media_service_factory.h" | 5 #include "media/mojo/services/media_service_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "media/mojo/services/media_service.h" | 9 #include "media/mojo/services/media_service.h" |
| 10 #include "media/mojo/services/test_mojo_media_client.h" | 10 #include "media/mojo/services/test_mojo_media_client.h" |
| 11 #include "media/mojo/services/utility_mojo_media_client.h" |
| 11 | 12 |
| 12 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 13 #include "media/mojo/services/android_mojo_media_client.h" // nogncheck | 14 #include "media/mojo/services/android_mojo_media_client.h" // nogncheck |
| 14 #endif | 15 #endif |
| 15 | 16 |
| 16 namespace media { | 17 namespace media { |
| 17 | 18 |
| 18 std::unique_ptr<service_manager::Service> CreateMediaService() { | 19 std::unique_ptr<service_manager::Service> CreateMediaService() { |
| 19 #if defined(ENABLE_TEST_MOJO_MEDIA_CLIENT) | 20 #if defined(ENABLE_TEST_MOJO_MEDIA_CLIENT) |
| 20 return CreateMediaServiceForTesting(); | 21 return CreateMediaServiceForTesting(); |
| 21 #elif defined(OS_ANDROID) | 22 #elif defined(OS_ANDROID) |
| 22 return std::unique_ptr<service_manager::Service>( | 23 return std::unique_ptr<service_manager::Service>( |
| 23 new MediaService(base::MakeUnique<AndroidMojoMediaClient>())); | 24 new MediaService(base::MakeUnique<AndroidMojoMediaClient>())); |
| 24 #else | 25 #else |
| 25 NOTREACHED() << "No MediaService implementation available."; | 26 NOTREACHED() << "No MediaService implementation available."; |
| 26 return nullptr; | 27 return nullptr; |
| 27 #endif | 28 #endif |
| 28 } | 29 } |
| 29 | 30 |
| 30 std::unique_ptr<service_manager::Service> CreateMediaServiceForTesting() { | 31 std::unique_ptr<service_manager::Service> CreateMediaServiceForTesting() { |
| 31 return std::unique_ptr<service_manager::Service>( | 32 return std::unique_ptr<service_manager::Service>( |
| 32 new MediaService(base::MakeUnique<TestMojoMediaClient>())); | 33 new MediaService(base::MakeUnique<TestMojoMediaClient>())); |
| 33 } | 34 } |
| 34 | 35 |
| 36 std::unique_ptr<service_manager::Service> CreateUtilityMediaService() { |
| 37 return std::unique_ptr<service_manager::Service>( |
| 38 new MediaService(base::MakeUnique<UtilityMojoMediaClient>())); |
| 39 } |
| 40 |
| 35 } // namespace media | 41 } // namespace media |
| OLD | NEW |