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

Side by Side Diff: services/nacl/content_handler_main_nonsfi.cc

Issue 1382713002: Creating a pexe content handler to translate and run pexes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 <fcntl.h> 5 #include <fcntl.h>
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/application/content_handler_factory.h" 9 #include "mojo/application/content_handler_factory.h"
10 #include "mojo/data_pipe_utils/data_pipe_utils.h" 10 #include "mojo/data_pipe_utils/data_pipe_utils.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if (fd == -1) { 53 if (fd == -1) {
54 LOG(FATAL) << "Could not dup the file descriptor"; 54 LOG(FATAL) << "Could not dup the file descriptor";
55 } 55 }
56 if (fclose(nexe_file_stream)) { 56 if (fclose(nexe_file_stream)) {
57 LOG(FATAL) << "Failed to close temp file"; 57 LOG(FATAL) << "Failed to close temp file";
58 } 58 }
59 59
60 MojoHandle handle = 60 MojoHandle handle =
61 application_request.PassMessagePipe().release().value(); 61 application_request.PassMessagePipe().release().value();
62 // MojoLaunchNexeNonsfi takes ownership of the fd. 62 // MojoLaunchNexeNonsfi takes ownership of the fd.
63 MojoLaunchNexeNonsfi(fd, handle); 63 MojoLaunchNexeNonsfi(fd, handle, false /* enable_translation_irt */);
64 } 64 }
65 65
66 mojo::ContentHandlerFactory content_handler_factory_; 66 mojo::ContentHandlerFactory content_handler_factory_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(NaClContentHandler); 68 DISALLOW_COPY_AND_ASSIGN(NaClContentHandler);
69 }; 69 };
70 70
71 } // namespace content_handler 71 } // namespace content_handler
72 } // namespace nacl 72 } // namespace nacl
73 73
74 MojoResult MojoMain(MojoHandle application_request) { 74 MojoResult MojoMain(MojoHandle application_request) {
75 mojo::ApplicationRunnerChromium runner( 75 mojo::ApplicationRunnerChromium runner(
76 new nacl::content_handler::NaClContentHandler()); 76 new nacl::content_handler::NaClContentHandler());
77 return runner.Run(application_request); 77 return runner.Run(application_request);
78 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698