OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 "ppapi/nacl_irt/irt_manifest.h" | |
6 | |
7 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" | |
8 #include "ppapi/nacl_irt/manifest_service.h" | |
9 #include "ppapi/nacl_irt/plugin_startup.h" | |
10 | |
11 namespace ppapi { | |
12 | |
13 int IrtOpenResource(const char* file, int* fd) { | |
Mark Seaborn
2014/04/30 21:20:58
Can you move this into ppapi/nacl_irt/manifest_ser
hidehiko
2014/05/01 05:20:31
Done. Note that please let me keep the header file
| |
14 // Remove leading '/' character. | |
15 if (file[0] == '/') | |
16 ++file; | |
17 | |
18 ManifestService* manifest_service = GetManifestService(); | |
19 if (manifest_service == NULL || | |
20 !manifest_service->OpenResource(file, fd)) { | |
21 return NACL_ABI_EIO; | |
22 } | |
23 | |
24 return (*fd == -1) ? NACL_ABI_ENOENT : 0; | |
25 } | |
26 | |
27 } // namespace ppapi | |
OLD | NEW |