| 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 | 11 |
| 12 #if defined(OS_ANDROID) | 12 #if defined(OS_ANDROID) |
| 13 #include "media/mojo/services/android_mojo_media_client.h" // nogncheck | 13 #include "media/mojo/services/android_mojo_media_client.h" // nogncheck |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 namespace media { | 16 namespace media { |
| 17 | 17 |
| 18 std::unique_ptr<service_manager::Service> CreateMediaService( | 18 std::unique_ptr<service_manager::Service> CreateMediaService() { |
| 19 const base::Closure& quit_closure) { | |
| 20 #if defined(ENABLE_TEST_MOJO_MEDIA_CLIENT) | 19 #if defined(ENABLE_TEST_MOJO_MEDIA_CLIENT) |
| 21 return CreateMediaServiceForTesting(quit_closure); | 20 return CreateMediaServiceForTesting(); |
| 22 #elif defined(OS_ANDROID) | 21 #elif defined(OS_ANDROID) |
| 23 return std::unique_ptr<service_manager::Service>(new MediaService( | 22 return std::unique_ptr<service_manager::Service>( |
| 24 base::MakeUnique<AndroidMojoMediaClient>(), quit_closure)); | 23 new MediaService(base::MakeUnique<AndroidMojoMediaClient>())); |
| 25 #else | 24 #else |
| 26 NOTREACHED() << "No MediaService implementation available."; | 25 NOTREACHED() << "No MediaService implementation available."; |
| 27 return nullptr; | 26 return nullptr; |
| 28 #endif | 27 #endif |
| 29 } | 28 } |
| 30 | 29 |
| 31 std::unique_ptr<service_manager::Service> CreateMediaServiceForTesting( | 30 std::unique_ptr<service_manager::Service> CreateMediaServiceForTesting() { |
| 32 const base::Closure& quit_closure) { | |
| 33 return std::unique_ptr<service_manager::Service>( | 31 return std::unique_ptr<service_manager::Service>( |
| 34 new MediaService(base::MakeUnique<TestMojoMediaClient>(), quit_closure)); | 32 new MediaService(base::MakeUnique<TestMojoMediaClient>())); |
| 35 } | 33 } |
| 36 | 34 |
| 37 } // namespace media | 35 } // namespace media |
| OLD | NEW |