OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/nacl/common/nacl_service.h" | 5 #include "components/nacl/common/nacl_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 registry->AddInterface(base::Bind(&ConnectBootstrapChannel, | 94 registry->AddInterface(base::Bind(&ConnectBootstrapChannel, |
95 base::Passed(&ipc_channel_bootstrap_))); | 95 base::Passed(&ipc_channel_bootstrap_))); |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 } // namespace | 99 } // namespace |
100 | 100 |
101 std::unique_ptr<service_manager::ServiceContext> CreateNaClServiceContext( | 101 std::unique_ptr<service_manager::ServiceContext> CreateNaClServiceContext( |
102 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 102 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
103 mojo::ScopedMessagePipeHandle* ipc_channel) { | 103 mojo::ScopedMessagePipeHandle* ipc_channel) { |
104 auto ipc_support = | 104 auto ipc_support = base::MakeUnique<mojo::edk::ScopedIPCSupport>( |
105 base::MakeUnique<mojo::edk::ScopedIPCSupport>(std::move(io_task_runner)); | 105 std::move(io_task_runner), |
| 106 mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST); |
106 EstablishMojoConnection(); | 107 EstablishMojoConnection(); |
107 | 108 |
108 IPC::mojom::ChannelBootstrapPtr bootstrap; | 109 IPC::mojom::ChannelBootstrapPtr bootstrap; |
109 *ipc_channel = mojo::MakeRequest(&bootstrap).PassMessagePipe(); | 110 *ipc_channel = mojo::MakeRequest(&bootstrap).PassMessagePipe(); |
110 return base::MakeUnique<service_manager::ServiceContext>( | 111 return base::MakeUnique<service_manager::ServiceContext>( |
111 base::MakeUnique<NaClService>(bootstrap.PassInterface(), | 112 base::MakeUnique<NaClService>(bootstrap.PassInterface(), |
112 std::move(ipc_support)), | 113 std::move(ipc_support)), |
113 ConnectToServiceManager()); | 114 ConnectToServiceManager()); |
114 } | 115 } |
OLD | NEW |