| 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 #include "media/mojo/services/mojo_media_application.h" | 5 #include "media/mojo/services/mojo_media_application.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "media/base/media_log.h" | 9 #include "media/base/media_log.h" |
| 10 #include "media/mojo/services/mojo_media_client.h" | 10 #include "media/mojo/services/mojo_media_client.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 void MojoMediaApplication::OnStart(shell::Connector* connector, | 30 void MojoMediaApplication::OnStart(shell::Connector* connector, |
| 31 const shell::Identity& identity, | 31 const shell::Identity& identity, |
| 32 uint32_t /* id */) { | 32 uint32_t /* id */) { |
| 33 connector_ = connector; | 33 connector_ = connector; |
| 34 mojo_media_client_->Initialize(); | 34 mojo_media_client_->Initialize(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool MojoMediaApplication::OnConnect(shell::Connection* connection) { | 37 bool MojoMediaApplication::OnConnect(shell::Connection* connection) { |
| 38 connection->AddInterface<mojom::ServiceFactory>(this); | 38 connection->AddInterface<mojom::ServiceFactory>(this); |
| 39 remote_interface_provider_ = connection->GetRemoteInterfaceProvider(); |
| 39 return true; | 40 return true; |
| 40 } | 41 } |
| 41 | 42 |
| 42 bool MojoMediaApplication::OnStop() { | 43 bool MojoMediaApplication::OnStop() { |
| 43 mojo_media_client_->WillQuit(); | 44 mojo_media_client_->WillQuit(); |
| 44 return true; | 45 return true; |
| 45 } | 46 } |
| 46 | 47 |
| 47 void MojoMediaApplication::Create( | 48 void MojoMediaApplication::Create( |
| 48 shell::Connection* connection, | 49 const shell::Identity& remote_identity, |
| 49 mojo::InterfaceRequest<mojom::ServiceFactory> request) { | 50 mojo::InterfaceRequest<mojom::ServiceFactory> request) { |
| 50 // The created object is owned by the pipe. | 51 // The created object is owned by the pipe. |
| 51 new ServiceFactoryImpl(std::move(request), | 52 new ServiceFactoryImpl(std::move(request), remote_interface_provider_, |
| 52 connection->GetRemoteInterfaceProvider(), media_log_, | 53 media_log_, ref_factory_.CreateRef(), |
| 53 ref_factory_.CreateRef(), mojo_media_client_.get()); | 54 mojo_media_client_.get()); |
| 54 } | 55 } |
| 55 | 56 |
| 56 } // namespace media | 57 } // namespace media |
| OLD | NEW |