OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <fcntl.h> | 5 #include <fcntl.h> |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "mojo/nacl/nonsfi/irt_mojo_nonsfi.h" | 10 #include "mojo/nacl/nonsfi/irt_mojo_nonsfi.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 void ServeTranslateRequest(const struct nacl_irt_pnacl_compile_funcs* funcs) { | 112 void ServeTranslateRequest(const struct nacl_irt_pnacl_compile_funcs* funcs) { |
113 // Acquire the handle -- this is our mechanism to contact the | 113 // Acquire the handle -- this is our mechanism to contact the |
114 // content handler which called us. | 114 // content handler which called us. |
115 MojoHandle handle; | 115 MojoHandle handle; |
116 nacl::MojoGetInitialHandle(&handle); | 116 nacl::MojoGetInitialHandle(&handle); |
117 | 117 |
118 // Convert the MojoHandle into a ScopedMessagePipeHandle, and use that to | 118 // Convert the MojoHandle into a ScopedMessagePipeHandle, and use that to |
119 // implement the PexeCompiler interface. | 119 // implement the PexeCompiler interface. |
120 PexeCompilerImpl impl( | 120 PexeCompilerImpl impl( |
121 mojo::MakeRequest<mojo::nacl::PexeCompiler>( | 121 mojo::InterfaceRequest<mojo::nacl::PexeCompiler>( |
122 mojo::ScopedMessagePipeHandle(mojo::MessagePipeHandle(handle))), | 122 mojo::ScopedMessagePipeHandle(mojo::MessagePipeHandle(handle))), |
123 funcs); | 123 funcs); |
124 mojo::RunLoop::current()->Run(); | 124 mojo::RunLoop::current()->Run(); |
125 } | 125 } |
126 | 126 |
127 } // namespace anonymous | 127 } // namespace anonymous |
128 | 128 |
129 namespace nacl { | 129 namespace nacl { |
130 | 130 |
131 const struct nacl_irt_private_pnacl_translator_compile | 131 const struct nacl_irt_private_pnacl_translator_compile |
132 nacl_irt_private_pnacl_translator_compile = { | 132 nacl_irt_private_pnacl_translator_compile = { |
133 ServeTranslateRequest | 133 ServeTranslateRequest |
134 }; | 134 }; |
135 | 135 |
136 } // namespace nacl | 136 } // namespace nacl |
OLD | NEW |