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

Unified Diff: runtime/bin/file.h

Issue 1781883002: Fixes some memory leaks in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix tests on Windows Created 4 years, 9 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/fdutils_android.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 633c006175fa77f3f081815644e2b4b85f2a5b3e..315ebbe51d707addb2ae7870c11f5e97b90037fc 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -13,7 +13,6 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
-
namespace dart {
namespace bin {
@@ -129,7 +128,10 @@ class File {
// reading. If mode contains kWrite the file is opened for both
// 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.
+ // mode contains kTruncate. Assumes we are in an API scope.
+ static File* ScopedOpen(const char* path, FileOpenMode mode);
+
+ // Like ScopedOpen(), but no API scope is needed.
static File* Open(const char* path, FileOpenMode mode);
// Create a file object for the specified stdio file descriptor
@@ -147,9 +149,9 @@ class File {
static int64_t LengthFromPath(const char* path);
static void Stat(const char* path, int64_t* data);
static time_t LastModified(const char* path);
- static char* LinkTarget(const char* pathname);
+ static const char* LinkTarget(const char* pathname);
static bool IsAbsolutePath(const char* path);
- static char* GetCanonicalPath(const char* path);
+ static const char* GetCanonicalPath(const char* path);
static const char* PathSeparator();
static const char* StringEscapedPathSeparator();
static Type GetType(const char* path, bool follow_links);
@@ -191,6 +193,8 @@ class File {
explicit File(FileHandle* handle) : handle_(handle) { }
void Close();
+ static File* FileOpenW(const wchar_t* system_name, FileOpenMode mode);
+
static const int kClosedFd = -1;
// FileHandle is an OS specific class which stores data about the file.
« no previous file with comments | « runtime/bin/fdutils_android.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698