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

Side by Side Diff: runtime/bin/directory.h

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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/directory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BIN_DIRECTORY_H_ 5 #ifndef BIN_DIRECTORY_H_
6 #define BIN_DIRECTORY_H_ 6 #define BIN_DIRECTORY_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/dartutils.h" 9 #include "bin/dartutils.h"
10 #include "platform/globals.h" 10 #include "platform/globals.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // later on. 58 // later on.
59 // 59 //
60 // The stack is managed by the DirectoryListing's PathBuffer. Each 60 // The stack is managed by the DirectoryListing's PathBuffer. Each
61 // DirectoryListingEntry stored a entry-length, that it'll reset the PathBuffer 61 // DirectoryListingEntry stored a entry-length, that it'll reset the PathBuffer
62 // to on each call to Next. 62 // to on each call to Next.
63 class DirectoryListingEntry { 63 class DirectoryListingEntry {
64 public: 64 public:
65 explicit DirectoryListingEntry(DirectoryListingEntry* parent) 65 explicit DirectoryListingEntry(DirectoryListingEntry* parent)
66 : parent_(parent), lister_(0), done_(false), link_(NULL) {} 66 : parent_(parent), lister_(0), done_(false), link_(NULL) {}
67 67
68 ~DirectoryListingEntry() { 68 ~DirectoryListingEntry();
69 ResetLink();
70 }
71 69
72 ListType Next(DirectoryListing* listing); 70 ListType Next(DirectoryListing* listing);
73 71
74 DirectoryListingEntry* parent() const { 72 DirectoryListingEntry* parent() const {
75 return parent_; 73 return parent_;
76 } 74 }
77 75
78 LinkList* link() { 76 LinkList* link() {
79 return link_; 77 return link_;
80 } 78 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 272
275 private: 273 private:
276 DISALLOW_ALLOCATION(); 274 DISALLOW_ALLOCATION();
277 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); 275 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory);
278 }; 276 };
279 277
280 } // namespace bin 278 } // namespace bin
281 } // namespace dart 279 } // namespace dart
282 280
283 #endif // BIN_DIRECTORY_H_ 281 #endif // BIN_DIRECTORY_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698