| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 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/directory.h" | 5 #include "bin/directory.h" |
| 6 | 6 |
| 7 #include "bin/dartutils.h" | 7 #include "bin/dartutils.h" |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // Create the list to hold the directory listing here, and pass it to the | 136 // Create the list to hold the directory listing here, and pass it to the |
| 137 // SyncDirectoryListing object, which adds elements to it. | 137 // SyncDirectoryListing object, which adds elements to it. |
| 138 Dart_Handle follow_links = Dart_GetNativeArgument(args, 2); | 138 Dart_Handle follow_links = Dart_GetNativeArgument(args, 2); |
| 139 // Create the list to hold the directory listing here, and pass it to the | 139 // Create the list to hold the directory listing here, and pass it to the |
| 140 // SyncDirectoryListing object, which adds elements to it. | 140 // SyncDirectoryListing object, which adds elements to it. |
| 141 Dart_Handle results = | 141 Dart_Handle results = |
| 142 Dart_New(DartUtils::GetDartType(DartUtils::kCoreLibURL, "List"), | 142 Dart_New(DartUtils::GetDartType(DartUtils::kCoreLibURL, "List"), |
| 143 Dart_Null(), | 143 Dart_Null(), |
| 144 0, | 144 0, |
| 145 NULL); | 145 NULL); |
| 146 if (Dart_IsError(results)) Dart_PropagateError(results); |
| 146 SyncDirectoryListing sync_listing(results, | 147 SyncDirectoryListing sync_listing(results, |
| 147 DartUtils::GetStringValue(path), | 148 DartUtils::GetStringValue(path), |
| 148 DartUtils::GetBooleanValue(recursive), | 149 DartUtils::GetBooleanValue(recursive), |
| 149 DartUtils::GetBooleanValue(follow_links)); | 150 DartUtils::GetBooleanValue(follow_links)); |
| 150 Directory::List(&sync_listing); | 151 Directory::List(&sync_listing); |
| 151 Dart_SetReturnValue(args, results); | 152 Dart_SetReturnValue(args, results); |
| 152 } | 153 } |
| 153 | 154 |
| 154 | 155 |
| 155 CObject* Directory::CreateRequest(const CObjectArray& request) { | 156 CObject* Directory::CreateRequest(const CObjectArray& request) { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 if (listing->error()) { | 421 if (listing->error()) { |
| 421 listing->HandleError("Invalid path"); | 422 listing->HandleError("Invalid path"); |
| 422 listing->HandleDone(); | 423 listing->HandleDone(); |
| 423 } else { | 424 } else { |
| 424 while (ListNext(listing)) {} | 425 while (ListNext(listing)) {} |
| 425 } | 426 } |
| 426 } | 427 } |
| 427 | 428 |
| 428 } // namespace bin | 429 } // namespace bin |
| 429 } // namespace dart | 430 } // namespace dart |
| OLD | NEW |