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

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

Issue 9773018: Add error handling to directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 years, 8 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 | 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"
11 #include "platform/thread.h" 11 #include "platform/thread.h"
12 12
13 class DirectoryListing { 13 class DirectoryListing {
14 public: 14 public:
15 enum Response { 15 enum Response {
16 kListDirectory = 0, 16 kListDirectory = 0,
17 kListFile = 1, 17 kListFile = 1,
18 kListError = 2, 18 kListError = 2,
19 kListDone = 3 19 kListDone = 3
20 }; 20 };
21 21
22 explicit DirectoryListing(Dart_Port response_port) 22 explicit DirectoryListing(Dart_Port response_port)
23 : response_port_(response_port) {} 23 : response_port_(response_port) {}
24 bool HandleDirectory(char* dir_name); 24 bool HandleDirectory(char* dir_name);
25 bool HandleFile(char* file_name); 25 bool HandleFile(char* file_name);
26 bool HandleError(char* message); 26 bool HandleError(const char* dir_name);
27 27
28 private: 28 private:
29 CObjectArray* NewResponse(Response response, char* arg); 29 CObjectArray* NewResponse(Response response, char* arg);
30 Dart_Port response_port_; 30 Dart_Port response_port_;
31 31
32 DISALLOW_IMPLICIT_CONSTRUCTORS(DirectoryListing); 32 DISALLOW_IMPLICIT_CONSTRUCTORS(DirectoryListing);
33 }; 33 };
34 34
35 35
36 class Directory { 36 class Directory {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 static int service_ports_size_; 70 static int service_ports_size_;
71 static Dart_Port* service_ports_; 71 static Dart_Port* service_ports_;
72 static int service_ports_index_; 72 static int service_ports_index_;
73 73
74 DISALLOW_ALLOCATION(); 74 DISALLOW_ALLOCATION();
75 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); 75 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory);
76 }; 76 };
77 77
78 78
79 #endif // BIN_DIRECTORY_H_ 79 #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