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

Unified Diff: native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc

Issue 15800004: [NaCl SDK] nacl_io: Added support for access() syscall. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixes, implement httpfs, and write tests. Created 7 years, 6 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: native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc b/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc
index 0008284253ace3c0c99b10b4be20b67622794ed8..ea1f1609a99df3b8715080f033122fbf4f8d6b1b 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc
@@ -6,6 +6,7 @@
#include "nacl_io/mount_html5fs.h"
#include <errno.h>
+#include <fcntl.h>
#include <ppapi/c/pp_completion_callback.h>
#include <ppapi/c/pp_errors.h>
#include <stdlib.h>
@@ -24,6 +25,22 @@ int64_t strtoull(const char* nptr, char** endptr, int base) {
} // namespace
+Error MountHtml5Fs::Access(const Path& path, int a_mode) {
+ // a_mode is unused, since all files are readable, writable and executable.
binji 2013/06/19 16:46:28 probably shouldn't allow executable for any mount
Matt Giuca 2013/06/20 01:43:14 OK let's discuss this here. You said in the email:
binji 2013/06/20 16:07:21 OK, I agree. :) I like a) better too..
+ if (BlockUntilFilesystemOpen() != PP_OK)
+ return ENODEV;
binji 2013/06/19 16:46:28 do you think this is the correct error value to re
Matt Giuca 2013/06/20 01:43:14 Oh wow, this was copied from Open() but then you c
+
+ PP_Resource fileref = ppapi()->GetFileRefInterface()->Create(
+ filesystem_resource_, path.Join().c_str());
+ if (!fileref)
+ return ENOENT;
+
+ MountNodeHtml5Fs* node = new MountNodeHtml5Fs(this, fileref);
binji 2013/06/19 16:46:28 does this do much more than querying the fileref?
Matt Giuca 2013/06/20 01:43:14 I don't know what you mean. Calling node->Init is
binji 2013/06/20 16:07:21 Yes, you're right about Init. It seemed like a pot
+ Error error = node->Init(O_RDONLY);
+ node->Release();
+ return error;
+}
+
Error MountHtml5Fs::Open(const Path& path, int mode, MountNode** out_node) {
*out_node = NULL;

Powered by Google App Engine
This is Rietveld 408576698