| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef MEDIA_MOJO_SERVICES_MEDIA_SERVICE_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MEDIA_SERVICE_H_ |
| 6 #define MEDIA_MOJO_SERVICES_MEDIA_SERVICE_H_ | 6 #define MEDIA_MOJO_SERVICES_MEDIA_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public NON_EXPORTED_BASE( | 31 public NON_EXPORTED_BASE( |
| 32 service_manager::InterfaceFactory<mojom::MediaService>), | 32 service_manager::InterfaceFactory<mojom::MediaService>), |
| 33 public NON_EXPORTED_BASE(mojom::MediaService) { | 33 public NON_EXPORTED_BASE(mojom::MediaService) { |
| 34 public: | 34 public: |
| 35 MediaService(std::unique_ptr<MojoMediaClient> mojo_media_client, | 35 MediaService(std::unique_ptr<MojoMediaClient> mojo_media_client, |
| 36 const base::Closure& quit_closure); | 36 const base::Closure& quit_closure); |
| 37 ~MediaService() final; | 37 ~MediaService() final; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // service_manager::Service implementation. | 40 // service_manager::Service implementation. |
| 41 void OnStart(const service_manager::ServiceInfo& info) final; | 41 void OnStart(service_manager::ServiceContext* context) final; |
| 42 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 42 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| 43 service_manager::InterfaceRegistry* registry) final; | 43 service_manager::InterfaceRegistry* registry) final; |
| 44 bool OnStop() final; | 44 bool OnStop() final; |
| 45 | 45 |
| 46 // service_manager::InterfaceFactory<mojom::MediaService> implementation. | 46 // service_manager::InterfaceFactory<mojom::MediaService> implementation. |
| 47 void Create(const service_manager::Identity& remote_identity, | 47 void Create(const service_manager::Identity& remote_identity, |
| 48 mojom::MediaServiceRequest request) final; | 48 mojom::MediaServiceRequest request) final; |
| 49 | 49 |
| 50 // mojom::MediaService implementation. | 50 // mojom::MediaService implementation. |
| 51 void CreateInterfaceFactory( | 51 void CreateInterfaceFactory( |
| 52 mojom::InterfaceFactoryRequest request, | 52 mojom::InterfaceFactoryRequest request, |
| 53 service_manager::mojom::InterfaceProviderPtr remote_interfaces) final; | 53 service_manager::mojom::InterfaceProviderPtr remote_interfaces) final; |
| 54 | 54 |
| 55 // Note: Since each instance runs on a different thread, do not share a common | 55 // Note: Since each instance runs on a different thread, do not share a common |
| 56 // MojoMediaClient with other instances to avoid threading issues. Hence using | 56 // MojoMediaClient with other instances to avoid threading issues. Hence using |
| 57 // a unique_ptr here. | 57 // a unique_ptr here. |
| 58 std::unique_ptr<MojoMediaClient> mojo_media_client_; | 58 std::unique_ptr<MojoMediaClient> mojo_media_client_; |
| 59 | 59 |
| 60 scoped_refptr<MediaLog> media_log_; | 60 scoped_refptr<MediaLog> media_log_; |
| 61 service_manager::ServiceContextRefFactory ref_factory_; | 61 service_manager::ServiceContextRefFactory ref_factory_; |
| 62 | 62 |
| 63 mojo::BindingSet<mojom::MediaService> bindings_; | 63 mojo::BindingSet<mojom::MediaService> bindings_; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace media | 66 } // namespace media |
| 67 | 67 |
| 68 #endif // MEDIA_MOJO_SERVICES_MEDIA_SERVICE_H_ | 68 #endif // MEDIA_MOJO_SERVICES_MEDIA_SERVICE_H_ |
| OLD | NEW |