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

Side by Side Diff: mojo/nacl/nonsfi/irt_resource_open.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: Added Mojom interface to communicate with translation nexes 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <fcntl.h>
6
7 #include "base/files/file_util.h"
8 #include "mojo/nacl/nonsfi/irt_mojo_nonsfi.h"
9 #include "native_client/src/untrusted/irt/irt_dev.h"
10
11 namespace {
12
13 int IrtOpenResource(const char *filename, int *newfd) {
Mark Seaborn 2015/10/27 17:30:20 Nit: use "* " spacing
Sean Klein 2015/10/28 17:02:41 Done.
14 std::string path = "native_client/toolchain/linux_x86/pnacl_translator/"
15 "translator/x86-32-nonsfi/lib/";
16 if (strcmp(filename, "libpnacl_irt_shim.a"))
17 path.append(filename);
18 else
19 path.append("libpnacl_irt_shim_dummy.a");
20 int rv = open(path.c_str(), O_RDONLY);
21 if (rv < 0)
22 return -errno;
23 *newfd = rv;
24 return 0;
25 }
26
27 } // namespace anonymous
28
29 namespace nacl {
30
31 const struct nacl_irt_resource_open nacl_irt_resource_open = {
32 IrtOpenResource,
33 };
34
35 } // namespace nacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698