Chromium Code Reviews| Index: ppapi/nacl_irt/irt_manifest.cc |
| diff --git a/ppapi/nacl_irt/irt_manifest.cc b/ppapi/nacl_irt/irt_manifest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c9e58d312cc28c28820b01e8513aec8570050881 |
| --- /dev/null |
| +++ b/ppapi/nacl_irt/irt_manifest.cc |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ppapi/nacl_irt/irt_manifest.h" |
| + |
| +#include "native_client/src/trusted/service_runtime/include/sys/errno.h" |
| +#include "ppapi/nacl_irt/manifest_service.h" |
| +#include "ppapi/nacl_irt/plugin_startup.h" |
| + |
| +namespace ppapi { |
| + |
| +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
|
| + // Remove leading '/' character. |
| + if (file[0] == '/') |
| + ++file; |
| + |
| + ManifestService* manifest_service = GetManifestService(); |
| + if (manifest_service == NULL || |
| + !manifest_service->OpenResource(file, fd)) { |
| + return NACL_ABI_EIO; |
| + } |
| + |
| + return (*fd == -1) ? NACL_ABI_ENOENT : 0; |
| +} |
| + |
| +} // namespace ppapi |