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 RUNTIME_BIN_DIRECTORY_H_ | 5 #ifndef RUNTIME_BIN_DIRECTORY_H_ |
6 #define RUNTIME_BIN_DIRECTORY_H_ | 6 #define RUNTIME_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/reference_counting.h" | 10 #include "bin/reference_counting.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 intptr_t length_; | 186 intptr_t length_; |
187 | 187 |
188 friend class ReferenceCounted<AsyncDirectoryListing>; | 188 friend class ReferenceCounted<AsyncDirectoryListing>; |
189 DISALLOW_IMPLICIT_CONSTRUCTORS(AsyncDirectoryListing); | 189 DISALLOW_IMPLICIT_CONSTRUCTORS(AsyncDirectoryListing); |
190 }; | 190 }; |
191 | 191 |
192 | 192 |
193 class SyncDirectoryListing : public DirectoryListing { | 193 class SyncDirectoryListing : public DirectoryListing { |
194 public: | 194 public: |
195 SyncDirectoryListing(Dart_Handle results, | 195 SyncDirectoryListing(Dart_Handle results, |
196 Dart_Handle* dart_error, | |
196 const char* dir_name, | 197 const char* dir_name, |
197 bool recursive, | 198 bool recursive, |
198 bool follow_links) | 199 bool follow_links) |
199 : DirectoryListing(dir_name, recursive, follow_links), results_(results) { | 200 : DirectoryListing(dir_name, recursive, follow_links), |
201 results_(results), | |
202 dart_error_(dart_error) { | |
200 add_string_ = DartUtils::NewString("add"); | 203 add_string_ = DartUtils::NewString("add"); |
201 directory_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Directory"); | 204 directory_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Directory"); |
202 file_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "File"); | 205 file_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "File"); |
203 link_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Link"); | 206 link_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Link"); |
204 } | 207 } |
205 virtual ~SyncDirectoryListing() {} | 208 virtual ~SyncDirectoryListing() {} |
206 virtual bool HandleDirectory(const char* dir_name); | 209 virtual bool HandleDirectory(const char* dir_name); |
207 virtual bool HandleFile(const char* file_name); | 210 virtual bool HandleFile(const char* file_name); |
208 virtual bool HandleLink(const char* file_name); | 211 virtual bool HandleLink(const char* file_name); |
209 virtual bool HandleError(); | 212 virtual bool HandleError(); |
210 | 213 |
211 private: | 214 private: |
212 Dart_Handle results_; | 215 Dart_Handle results_; |
213 Dart_Handle add_string_; | 216 Dart_Handle add_string_; |
214 Dart_Handle directory_type_; | 217 Dart_Handle directory_type_; |
215 Dart_Handle file_type_; | 218 Dart_Handle file_type_; |
216 Dart_Handle link_type_; | 219 Dart_Handle link_type_; |
220 Dart_Handle* dart_error_; | |
zra
2017/01/23 17:04:51
DBC:
Why is this a pointer? Why can't it be a reg
kustermann
2017/01/23 18:45:32
I made it a pointer to avoid an uninitialized vari
zra
2017/01/23 18:53:15
Not sure what you mean by this. What call site?
kustermann
2017/01/23 18:55:44
Line 128 here
https://codereview.chromium.org/265
| |
217 | 221 |
218 DISALLOW_ALLOCATION() | 222 DISALLOW_ALLOCATION() |
219 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncDirectoryListing); | 223 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncDirectoryListing); |
220 }; | 224 }; |
221 | 225 |
222 | 226 |
223 class Directory { | 227 class Directory { |
224 public: | 228 public: |
225 enum ExistsResult { UNKNOWN, EXISTS, DOES_NOT_EXIST }; | 229 enum ExistsResult { UNKNOWN, EXISTS, DOES_NOT_EXIST }; |
226 | 230 |
(...skipping 29 matching lines...) Expand all Loading... | |
256 private: | 260 private: |
257 static char* system_temp_path_override_; | 261 static char* system_temp_path_override_; |
258 DISALLOW_ALLOCATION(); | 262 DISALLOW_ALLOCATION(); |
259 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); | 263 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); |
260 }; | 264 }; |
261 | 265 |
262 } // namespace bin | 266 } // namespace bin |
263 } // namespace dart | 267 } // namespace dart |
264 | 268 |
265 #endif // RUNTIME_BIN_DIRECTORY_H_ | 269 #endif // RUNTIME_BIN_DIRECTORY_H_ |
OLD | NEW |