| 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 "content/child/mojo/mojo_application.h" | 5 #include "content/child/mojo/mojo_application.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/child/child_process.h" | 10 #include "content/child/child_process.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 IPC_MESSAGE_UNHANDLED(handled = false) | 32 IPC_MESSAGE_UNHANDLED(handled = false) |
| 33 IPC_END_MESSAGE_MAP() | 33 IPC_END_MESSAGE_MAP() |
| 34 return handled; | 34 return handled; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void MojoApplication::OnActivate( | 37 void MojoApplication::OnActivate( |
| 38 const IPC::PlatformFileForTransit& file) { | 38 const IPC::PlatformFileForTransit& file) { |
| 39 #if defined(OS_POSIX) | 39 #if defined(OS_POSIX) |
| 40 base::PlatformFile handle = file.fd; | 40 base::PlatformFile handle = file.fd; |
| 41 #elif defined(OS_WIN) | 41 #elif defined(OS_WIN) |
| 42 base::PlatformFile handle = file; | 42 base::PlatformFile handle = file.GetHandle(); |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 mojo::ScopedMessagePipeHandle pipe = | 45 mojo::ScopedMessagePipeHandle pipe = |
| 46 channel_init_.Init(handle, io_task_runner_); | 46 channel_init_.Init(handle, io_task_runner_); |
| 47 DCHECK(pipe.is_valid()); | 47 DCHECK(pipe.is_valid()); |
| 48 | 48 |
| 49 ApplicationSetupPtr application_setup; | 49 ApplicationSetupPtr application_setup; |
| 50 application_setup.Bind( | 50 application_setup.Bind( |
| 51 mojo::InterfacePtrInfo<ApplicationSetup>(std::move(pipe), 0u)); | 51 mojo::InterfacePtrInfo<ApplicationSetup>(std::move(pipe), 0u)); |
| 52 | 52 |
| 53 mojo::shell::mojom::InterfaceProviderPtr services; | 53 mojo::shell::mojom::InterfaceProviderPtr services; |
| 54 mojo::shell::mojom::InterfaceProviderPtr exposed_services; | 54 mojo::shell::mojom::InterfaceProviderPtr exposed_services; |
| 55 service_registry_.Bind(GetProxy(&exposed_services)); | 55 service_registry_.Bind(GetProxy(&exposed_services)); |
| 56 application_setup->ExchangeInterfaceProviders(GetProxy(&services), | 56 application_setup->ExchangeInterfaceProviders(GetProxy(&services), |
| 57 std::move(exposed_services)); | 57 std::move(exposed_services)); |
| 58 service_registry_.BindRemoteServiceProvider(std::move(services)); | 58 service_registry_.BindRemoteServiceProvider(std::move(services)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace content | 61 } // namespace content |
| OLD | NEW |