Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
|
Ivan Posva
2012/01/13 23:22:06
2012, maybe others...
Søren Gjesse
2012/01/16 08:58:00
Done.
| |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
| 6 #include "bin/directory.h" | 6 #include "bin/directory.h" |
|
Ivan Posva
2012/01/13 23:22:06
Should bin/directory.h be first when being include
Søren Gjesse
2012/01/16 08:58:00
Done.
| |
| 7 | |
| 8 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | |
| 9 | 9 |
| 10 static intptr_t GetHandlerPort(Dart_Handle handle) { | 10 static intptr_t GetHandlerPort(Dart_Handle handle) { |
| 11 if (Dart_IsNull(handle)) { | 11 if (Dart_IsNull(handle)) { |
| 12 return 0; | 12 return 0; |
| 13 } | 13 } |
| 14 return DartUtils::GetIntegerInstanceField(handle, DartUtils::kIdFieldName); | 14 return DartUtils::GetIntegerInstanceField(handle, DartUtils::kIdFieldName); |
| 15 } | 15 } |
| 16 | 16 |
| 17 | 17 |
| 18 void FUNCTION_NAME(Directory_List)(Dart_NativeArguments args) { | 18 void FUNCTION_NAME(Directory_List)(Dart_NativeArguments args) { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 Dart_EnterScope(); | 121 Dart_EnterScope(); |
| 122 Dart_Handle path = Dart_GetNativeArgument(args, 0); | 122 Dart_Handle path = Dart_GetNativeArgument(args, 0); |
| 123 if (Dart_IsString(path)) { | 123 if (Dart_IsString(path)) { |
| 124 bool deleted = Directory::Delete(DartUtils::GetStringValue(path)); | 124 bool deleted = Directory::Delete(DartUtils::GetStringValue(path)); |
| 125 Dart_SetReturnValue(args, Dart_NewBoolean(deleted)); | 125 Dart_SetReturnValue(args, Dart_NewBoolean(deleted)); |
| 126 } else { | 126 } else { |
| 127 Dart_SetReturnValue(args, Dart_NewBoolean(false)); | 127 Dart_SetReturnValue(args, Dart_NewBoolean(false)); |
| 128 } | 128 } |
| 129 Dart_ExitScope(); | 129 Dart_ExitScope(); |
| 130 } | 130 } |
| OLD | NEW |