Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: services/nacl/nonsfi/pnacl_compile.cc

Issue 1932713003: More SynchronousInterfacePtr conversion + some related pexe content handler cleanup. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 5 #include <memory>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/nacl/nonsfi/file_util.h" 8 #include "mojo/nacl/nonsfi/file_util.h"
9 #include "mojo/nacl/nonsfi/nexe_launcher_nonsfi.h" 9 #include "mojo/nacl/nonsfi/nexe_launcher_nonsfi.h"
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
11 #include "mojo/public/cpp/application/application_connection.h" 11 #include "mojo/public/cpp/application/application_connection.h"
12 #include "mojo/public/cpp/application/application_delegate.h" 12 #include "mojo/public/cpp/application/application_delegate.h"
13 #include "mojo/public/cpp/application/application_runner.h" 13 #include "mojo/public/cpp/application/application_runner.h"
14 #include "mojo/public/cpp/application/interface_factory.h" 14 #include "mojo/public/cpp/application/interface_factory.h"
15 #include "mojo/public/cpp/bindings/strong_binding.h" 15 #include "mojo/public/cpp/bindings/strong_binding.h"
16 #include "services/nacl/nonsfi/kPnaclTranslatorCompile.h" 16 #include "services/nacl/nonsfi/kPnaclTranslatorCompile.h"
17 #include "services/nacl/nonsfi/pnacl_compile.mojom.h" 17 #include "services/nacl/nonsfi/pnacl_compile.mojom.h"
18 18
19 namespace mojo { 19 namespace mojo {
20 namespace nacl { 20 namespace nacl {
21 21
22 class PexeCompilerImpl : public PexeCompilerInit { 22 class PexeCompilerImpl : public PexeCompilerInit {
23 public: 23 public:
24 void PexeCompilerStart(ScopedMessagePipeHandle handle) override { 24 void PexeCompilerStart(
25 InterfaceRequest<PexeCompiler> compiler_request) override {
25 int nexe_fd = 26 int nexe_fd =
26 ::nacl::DataToTempFileDescriptor(::nacl::kPnaclTranslatorCompile); 27 ::nacl::DataToTempFileDescriptor(::nacl::kPnaclTranslatorCompile);
27 CHECK(nexe_fd >= 0) << "Could not open compiler nexe"; 28 CHECK(nexe_fd >= 0) << "Could not open compiler nexe";
28 ::nacl::MojoLaunchNexeNonsfi(nexe_fd, 29 ::nacl::MojoLaunchNexeNonsfi(
29 handle.release().value(), 30 nexe_fd, compiler_request.PassMessagePipe().release().value(),
30 true /* enable_translate_irt */); 31 true /* enable_translate_irt */);
31 } 32 }
32 }; 33 };
33 34
34 class StrongBindingPexeCompilerImpl : public PexeCompilerImpl { 35 class StrongBindingPexeCompilerImpl : public PexeCompilerImpl {
35 public: 36 public:
36 explicit StrongBindingPexeCompilerImpl(InterfaceRequest<PexeCompilerInit> 37 explicit StrongBindingPexeCompilerImpl(InterfaceRequest<PexeCompilerInit>
37 request) 38 request)
38 : strong_binding_(this, request.Pass()) {} 39 : strong_binding_(this, request.Pass()) {}
39 40
40 private: 41 private:
(...skipping 19 matching lines...) Expand all
60 }; 61 };
61 62
62 } // namespace nacl 63 } // namespace nacl
63 } // namespace mojo 64 } // namespace mojo
64 65
65 MojoResult MojoMain(MojoHandle application_request) { 66 MojoResult MojoMain(MojoHandle application_request) {
66 mojo::ApplicationRunner runner(std::unique_ptr<mojo::nacl::MultiPexeCompiler>( 67 mojo::ApplicationRunner runner(std::unique_ptr<mojo::nacl::MultiPexeCompiler>(
67 new mojo::nacl::MultiPexeCompiler())); 68 new mojo::nacl::MultiPexeCompiler()));
68 return runner.Run(application_request); 69 return runner.Run(application_request);
69 } 70 }
OLDNEW
« no previous file with comments | « services/nacl/nonsfi/content_handler_main_pexe.cc ('k') | services/nacl/nonsfi/pnacl_compile.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698