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

Unified Diff: runtime/bin/file.cc

Issue 15832003: Change File.directory to not do any IO (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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/file.h ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index b885f5421f505d6ea30b031e9409db6bab290982..67d67e33dd72b738c29feb5601abda99b738ed09 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -506,25 +506,6 @@ void FUNCTION_NAME(File_DeleteLink)(Dart_NativeArguments args) {
}
-void FUNCTION_NAME(File_Directory)(Dart_NativeArguments args) {
- Dart_EnterScope();
- const char* str =
- DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
- char* str_copy = strdup(str);
- char* path = File::GetContainingDirectory(str_copy);
- free(str_copy);
- if (path != NULL) {
- Dart_SetReturnValue(args, DartUtils::NewString(path));
- free(path);
- } else {
- Dart_Handle err = DartUtils::NewDartOSError();
- if (Dart_IsError(err)) Dart_PropagateError(err);
- Dart_SetReturnValue(args, err);
- }
- Dart_ExitScope();
-}
-
-
void FUNCTION_NAME(File_FullPath)(Dart_NativeArguments args) {
Dart_EnterScope();
const char* str =
@@ -735,24 +716,6 @@ static CObject* FileFullPathRequest(const CObjectArray& request) {
}
-static CObject* FileDirectoryRequest(const CObjectArray& request) {
- if (request.Length() == 2 && request[1]->IsString()) {
- CObjectString filename(request[1]);
- char* str_copy = strdup(filename.CString());
- char* path = File::GetContainingDirectory(str_copy);
- free(str_copy);
- if (path != NULL) {
- CObject* result = new CObjectString(CObject::NewString(path));
- free(path);
- return result;
- } else {
- return CObject::NewOSError();
- }
- }
- return CObject::Null();
-}
-
-
static CObject* FileCloseRequest(const CObjectArray& request) {
intptr_t return_value = -1;
if (request.Length() == 2 && request[1]->IsIntptr()) {
@@ -1198,9 +1161,6 @@ static void FileService(Dart_Port dest_port_id,
case File::kFullPathRequest:
response = FileFullPathRequest(request);
break;
- case File::kDirectoryRequest:
- response = FileDirectoryRequest(request);
- break;
case File::kCloseRequest:
response = FileCloseRequest(request);
break;
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698