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

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

Issue 2653583002: VM: Fix asan memory leak in some standalone tests (Closed)
Patch Set: addressed comments Created 3 years, 11 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 unified diff | Download patch
« 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 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const char* dir_name, 196 const char* dir_name,
197 bool recursive, 197 bool recursive,
198 bool follow_links) 198 bool follow_links)
199 : DirectoryListing(dir_name, recursive, follow_links), results_(results) { 199 : DirectoryListing(dir_name, recursive, follow_links),
200 results_(results),
201 dart_error_(Dart_Null()) {
200 add_string_ = DartUtils::NewString("add"); 202 add_string_ = DartUtils::NewString("add");
201 directory_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Directory"); 203 directory_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Directory");
202 file_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "File"); 204 file_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "File");
203 link_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Link"); 205 link_type_ = DartUtils::GetDartType(DartUtils::kIOLibURL, "Link");
204 } 206 }
205 virtual ~SyncDirectoryListing() {} 207 virtual ~SyncDirectoryListing() {}
206 virtual bool HandleDirectory(const char* dir_name); 208 virtual bool HandleDirectory(const char* dir_name);
207 virtual bool HandleFile(const char* file_name); 209 virtual bool HandleFile(const char* file_name);
208 virtual bool HandleLink(const char* file_name); 210 virtual bool HandleLink(const char* file_name);
209 virtual bool HandleError(); 211 virtual bool HandleError();
210 212
213 Dart_Handle dart_error() { return dart_error_; }
214
211 private: 215 private:
212 Dart_Handle results_; 216 Dart_Handle results_;
213 Dart_Handle add_string_; 217 Dart_Handle add_string_;
214 Dart_Handle directory_type_; 218 Dart_Handle directory_type_;
215 Dart_Handle file_type_; 219 Dart_Handle file_type_;
216 Dart_Handle link_type_; 220 Dart_Handle link_type_;
221 Dart_Handle dart_error_;
217 222
218 DISALLOW_ALLOCATION() 223 DISALLOW_ALLOCATION()
219 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncDirectoryListing); 224 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncDirectoryListing);
220 }; 225 };
221 226
222 227
223 class Directory { 228 class Directory {
224 public: 229 public:
225 enum ExistsResult { UNKNOWN, EXISTS, DOES_NOT_EXIST }; 230 enum ExistsResult { UNKNOWN, EXISTS, DOES_NOT_EXIST };
226 231
(...skipping 29 matching lines...) Expand all
256 private: 261 private:
257 static char* system_temp_path_override_; 262 static char* system_temp_path_override_;
258 DISALLOW_ALLOCATION(); 263 DISALLOW_ALLOCATION();
259 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); 264 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory);
260 }; 265 };
261 266
262 } // namespace bin 267 } // namespace bin
263 } // namespace dart 268 } // namespace dart
264 269
265 #endif // RUNTIME_BIN_DIRECTORY_H_ 270 #endif // RUNTIME_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