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_MOJO_MEDIA_APPLICATION_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 16 matching lines...) Expand all Loading... |
27 class MEDIA_MOJO_EXPORT MojoMediaApplication | 27 class MEDIA_MOJO_EXPORT MojoMediaApplication |
28 : public NON_EXPORTED_BASE(shell::Service), | 28 : public NON_EXPORTED_BASE(shell::Service), |
29 public NON_EXPORTED_BASE(shell::InterfaceFactory<mojom::ServiceFactory>) { | 29 public NON_EXPORTED_BASE(shell::InterfaceFactory<mojom::ServiceFactory>) { |
30 public: | 30 public: |
31 MojoMediaApplication(std::unique_ptr<MojoMediaClient> mojo_media_client, | 31 MojoMediaApplication(std::unique_ptr<MojoMediaClient> mojo_media_client, |
32 const base::Closure& quit_closure); | 32 const base::Closure& quit_closure); |
33 ~MojoMediaApplication() final; | 33 ~MojoMediaApplication() final; |
34 | 34 |
35 private: | 35 private: |
36 // shell::Service implementation. | 36 // shell::Service implementation. |
37 void OnStart(shell::Connector* connector, | 37 void OnStart(const shell::Identity& identity) final; |
38 const shell::Identity& identity, | |
39 uint32_t id) final; | |
40 bool OnConnect(shell::Connection* connection) final; | 38 bool OnConnect(shell::Connection* connection) final; |
41 bool OnStop() final; | 39 bool OnStop() final; |
42 | 40 |
43 // shell::InterfaceFactory<mojom::ServiceFactory> implementation. | 41 // shell::InterfaceFactory<mojom::ServiceFactory> implementation. |
44 void Create(const shell::Identity& remote_identity, | 42 void Create(const shell::Identity& remote_identity, |
45 mojo::InterfaceRequest<mojom::ServiceFactory> request) final; | 43 mojo::InterfaceRequest<mojom::ServiceFactory> request) final; |
46 | 44 |
47 // Note: Since each instance runs on a different thread, do not share a common | 45 // Note: Since each instance runs on a different thread, do not share a common |
48 // MojoMediaClient with other instances to avoid threading issues. Hence using | 46 // MojoMediaClient with other instances to avoid threading issues. Hence using |
49 // a unique_ptr here. | 47 // a unique_ptr here. |
50 std::unique_ptr<MojoMediaClient> mojo_media_client_; | 48 std::unique_ptr<MojoMediaClient> mojo_media_client_; |
51 | 49 |
52 shell::Connector* connector_; | |
53 shell::mojom::InterfaceProvider* remote_interface_provider_ = nullptr; | 50 shell::mojom::InterfaceProvider* remote_interface_provider_ = nullptr; |
54 scoped_refptr<MediaLog> media_log_; | 51 scoped_refptr<MediaLog> media_log_; |
55 shell::ServiceContextRefFactory ref_factory_; | 52 shell::ServiceContextRefFactory ref_factory_; |
56 }; | 53 }; |
57 | 54 |
58 } // namespace media | 55 } // namespace media |
59 | 56 |
60 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_ | 57 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_ |
OLD | NEW |