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

Unified Diff: runtime/bin/directory.cc

Issue 45833003: Fix directory-listing to return a future on cancel. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix reporting of immediate errors from directory listing. Created 7 years, 2 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.h ('k') | runtime/bin/directory_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory.cc
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc
index 058d6382b837f5b52c20cefd0c6234fb597a4794..01f9f758d052b50205f8c00b6494f6daa7ed2a68 100644
--- a/runtime/bin/directory.cc
+++ b/runtime/bin/directory.cc
@@ -262,6 +262,9 @@ CObject* Directory::ListNextRequest(const CObjectArray& request) {
CObjectIntptr ptr(request[0]);
AsyncDirectoryListing* dir_listing =
reinterpret_cast<AsyncDirectoryListing*>(ptr.Value());
+ if (dir_listing->IsEmpty()) {
+ return new CObjectArray(CObject::NewArray(0));
+ }
const int kArraySize = 128;
CObjectArray* response = new CObjectArray(CObject::NewArray(kArraySize));
dir_listing->SetArray(response, kArraySize);
« no previous file with comments | « runtime/bin/directory.h ('k') | runtime/bin/directory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698