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

Unified Diff: runtime/bin/file.h

Issue 3007703002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Remove namespace_unsupported.cc Created 3 years, 4 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
« no previous file with comments | « runtime/bin/directory_win.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.h
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 5bef22c92c33a9b0ebe1570c5a5ad1fea32f0019..c117ff3641442df0d3ad8601307fc7ca237a2895 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -13,6 +13,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
#include "bin/log.h"
+#include "bin/namespace.h"
#include "bin/reference_counting.h"
namespace dart {
@@ -172,36 +173,52 @@ class File : public ReferenceCounted<File> {
// reading and writing. If mode contains kWrite and the file does
// not exist the file is created. The file is truncated to length 0 if
// mode contains kTruncate. Assumes we are in an API scope.
- static File* Open(const char* path, FileOpenMode mode);
+ static File* Open(Namespace* namespc, const char* path, FileOpenMode mode);
// Create a file object for the specified stdio file descriptor
// (stdin, stout or stderr).
static File* OpenStdio(int fd);
- static bool Exists(const char* path);
- static bool Create(const char* path);
- static bool CreateLink(const char* path, const char* target);
- static bool Delete(const char* path);
- static bool DeleteLink(const char* path);
- static bool Rename(const char* old_path, const char* new_path);
- static bool RenameLink(const char* old_path, const char* new_path);
- static bool Copy(const char* old_path, const char* new_path);
- static int64_t LengthFromPath(const char* path);
- static void Stat(const char* path, int64_t* data);
- static time_t LastModified(const char* path);
- static bool SetLastModified(const char* path, int64_t millis);
- static time_t LastAccessed(const char* path);
- static bool SetLastAccessed(const char* path, int64_t millis);
+ static bool Exists(Namespace* namespc, const char* path);
+ static bool Create(Namespace* namespc, const char* path);
+ static bool CreateLink(Namespace* namespc,
+ const char* path,
+ const char* target);
+ static bool Delete(Namespace* namespc, const char* path);
+ static bool DeleteLink(Namespace* namespc, const char* path);
+ static bool Rename(Namespace* namespc,
+ const char* old_path,
+ const char* new_path);
+ static bool RenameLink(Namespace* namespc,
+ const char* old_path,
+ const char* new_path);
+ static bool Copy(Namespace* namespc,
+ const char* old_path,
+ const char* new_path);
+ static int64_t LengthFromPath(Namespace* namespc, const char* path);
+ static void Stat(Namespace* namespc, const char* path, int64_t* data);
+ static time_t LastModified(Namespace* namespc, const char* path);
+ static bool SetLastModified(Namespace* namespc,
+ const char* path,
+ int64_t millis);
+ static time_t LastAccessed(Namespace* namespc, const char* path);
+ static bool SetLastAccessed(Namespace* namespc,
+ const char* path,
+ int64_t millis);
static bool IsAbsolutePath(const char* path);
static const char* PathSeparator();
static const char* StringEscapedPathSeparator();
- static Type GetType(const char* path, bool follow_links);
- static Identical AreIdentical(const char* file_1, const char* file_2);
+ static Type GetType(Namespace* namespc, const char* path, bool follow_links);
+ static Identical AreIdentical(Namespace* namespc,
+ const char* file_1,
+ const char* file_2);
static StdioHandleType GetStdioHandleType(int fd);
- // LinkTarget and GetCanonicalPath may call Dart_ScopeAllocate.
- static const char* LinkTarget(const char* pathname);
- static const char* GetCanonicalPath(const char* path);
+ // LinkTarget, GetCanonicalPath, and ReadLink may call Dart_ScopeAllocate.
+ static const char* LinkTarget(Namespace* namespc, const char* pathname);
+ static const char* GetCanonicalPath(Namespace* namespc, const char* path);
+ // Link LinkTarget, but pathname must be absolute.
+ static const char* ReadLink(const char* pathname);
static FileOpenMode DartModeToFileMode(DartFileOpenMode mode);
« no previous file with comments | « runtime/bin/directory_win.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698