| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "media/mojo/interfaces/service_factory.mojom.h" | 10 #include "media/mojo/interfaces/service_factory.mojom.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 : public mojo::ShellClient, | 21 : public mojo::ShellClient, |
| 22 public mojo::InterfaceFactory<interfaces::ServiceFactory> { | 22 public mojo::InterfaceFactory<interfaces::ServiceFactory> { |
| 23 public: | 23 public: |
| 24 explicit MojoMediaApplication(scoped_ptr<MojoMediaClient> mojo_media_client); | 24 explicit MojoMediaApplication(scoped_ptr<MojoMediaClient> mojo_media_client); |
| 25 ~MojoMediaApplication() final; | 25 ~MojoMediaApplication() final; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 // mojo::ShellClient implementation. | 28 // mojo::ShellClient implementation. |
| 29 void Initialize(mojo::Shell* shell, | 29 void Initialize(mojo::Shell* shell, |
| 30 const std::string& url, | 30 const std::string& url, |
| 31 uint32_t id) final; | 31 uint32_t id, |
| 32 uint32_t user_id) final; |
| 32 bool AcceptConnection(mojo::Connection* connection) final; | 33 bool AcceptConnection(mojo::Connection* connection) final; |
| 33 | 34 |
| 34 // mojo::InterfaceFactory<interfaces::ServiceFactory> implementation. | 35 // mojo::InterfaceFactory<interfaces::ServiceFactory> implementation. |
| 35 void Create(mojo::Connection* connection, | 36 void Create(mojo::Connection* connection, |
| 36 mojo::InterfaceRequest<interfaces::ServiceFactory> request) final; | 37 mojo::InterfaceRequest<interfaces::ServiceFactory> request) final; |
| 37 | 38 |
| 38 // Note: Since each instance runs on a different thread, do not share a common | 39 // Note: Since each instance runs on a different thread, do not share a common |
| 39 // MojoMediaClient with other instances to avoid threading issues. Hence using | 40 // MojoMediaClient with other instances to avoid threading issues. Hence using |
| 40 // a scoped_ptr here. | 41 // a scoped_ptr here. |
| 41 scoped_ptr<MojoMediaClient> mojo_media_client_; | 42 scoped_ptr<MojoMediaClient> mojo_media_client_; |
| 42 | 43 |
| 43 mojo::Shell* shell_; | 44 mojo::Shell* shell_; |
| 44 scoped_refptr<MediaLog> media_log_; | 45 scoped_refptr<MediaLog> media_log_; |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 } // namespace media | 48 } // namespace media |
| 48 | 49 |
| 49 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_ | 50 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_ |
| OLD | NEW |