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 #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 "bin/native_service.h" | 10 #include "bin/native_service.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 | 78 |
79 LinkList* link() { | 79 LinkList* link() { |
80 return link_; | 80 return link_; |
81 } | 81 } |
82 | 82 |
83 void set_link(LinkList* link) { | 83 void set_link(LinkList* link) { |
84 link_ = link; | 84 link_ = link; |
85 } | 85 } |
86 | 86 |
87 void ResetLink() { | 87 void ResetLink(); |
88 if (link_ != NULL && (parent_ == NULL || parent_->link_ != link_)) { | |
89 free(link_); | |
90 link_ = NULL; | |
91 } | |
92 if (parent_ != NULL) { | |
93 link_ = parent_->link_; | |
94 } | |
95 } | |
96 | 88 |
97 private: | 89 private: |
98 DirectoryListingEntry* parent_; | 90 DirectoryListingEntry* parent_; |
99 intptr_t lister_; | 91 intptr_t lister_; |
100 bool done_; | 92 bool done_; |
101 int path_length_; | 93 int path_length_; |
102 LinkList* link_; | 94 LinkList* link_; |
103 | 95 |
104 DISALLOW_COPY_AND_ASSIGN(DirectoryListingEntry); | 96 DISALLOW_COPY_AND_ASSIGN(DirectoryListingEntry); |
105 }; | 97 }; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 static NativeService directory_service_; | 280 static NativeService directory_service_; |
289 | 281 |
290 DISALLOW_ALLOCATION(); | 282 DISALLOW_ALLOCATION(); |
291 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); | 283 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); |
292 }; | 284 }; |
293 | 285 |
294 } // namespace bin | 286 } // namespace bin |
295 } // namespace dart | 287 } // namespace dart |
296 | 288 |
297 #endif // BIN_DIRECTORY_H_ | 289 #endif // BIN_DIRECTORY_H_ |
OLD | NEW |