Chromium Code Reviews| 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 <errno.h> | |
| 8 | |
| 9 #include "ppapi/nacl_irt/manifest_service.h" | |
| 10 #include "ppapi/nacl_irt/plugin_startup.h" | |
| 11 | |
| 12 namespace ppapi { | |
| 13 | |
| 14 int IrtOpenResource(const char* file, int* fd) { | |
| 15 // Remove leading '/' character. | |
| 16 if (file[0] == '/') | |
| 17 ++file; | |
| 18 | |
| 19 ManifestService* manifest_service = GetManifestService(); | |
| 20 if (manifest_service == NULL || | |
| 21 !manifest_service->OpenResource(file, fd)) { | |
| 22 *fd = -1; | |
|
teravest
2014/04/24 20:00:52
Why set |fd| on failure? It seems unnecessary.
hidehiko
2014/04/25 05:53:54
Ok, then let's move this to ManifestService::OpenR
| |
| 23 return EIO; | |
| 24 } | |
| 25 | |
| 26 return (*fd == -1) ? ENOENT : 0; | |
| 27 } | |
| 28 | |
| 29 } // namespace ppapi | |
| OLD | NEW |