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

Unified Diff: ppapi/nacl_irt/irt_manifest.cc

Issue 249183004: Implement open_resource in non-SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
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..ea935089d384f8245ed0cb5031cfbf69f655a439
--- /dev/null
+++ b/ppapi/nacl_irt/irt_manifest.cc
@@ -0,0 +1,28 @@
+// 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 <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) {
+ // Remove leading '/' character.
+ if (file[0] == '/')
+ ++file;
+
+ ManifestService* manifest_service = GetManifestService();
+ if (manifest_service == NULL ||
+ !manifest_service->OpenResource(file, fd)) {
+ return EIO;
Mark Seaborn 2014/04/26 00:18:59 Does it work to #include native_client/src/trusted
hidehiko 2014/04/28 08:44:27 Done.
+ }
+
+ return (*fd == -1) ? ENOENT : 0;
+}
+
+} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698