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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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 | « runtime/bin/builtin_impl_sources.gypi ('k') | 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 "bin/native_service.h"
10 #include "platform/globals.h" 11 #include "platform/globals.h"
11 #include "platform/thread.h" 12 #include "platform/thread.h"
12 13
13 class DirectoryListing { 14 class DirectoryListing {
14 public: 15 public:
15 virtual ~DirectoryListing() {} 16 virtual ~DirectoryListing() {}
16 virtual bool HandleDirectory(char* dir_name) = 0; 17 virtual bool HandleDirectory(char* dir_name) = 0;
17 virtual bool HandleFile(char* file_name) = 0; 18 virtual bool HandleFile(char* file_name) = 0;
18 virtual bool HandleError(const char* dir_name) = 0; 19 virtual bool HandleError(const char* dir_name) = 0;
19 }; 20 };
20 21
21 22
22 class AsyncDirectoryListing : public DirectoryListing { 23 class AsyncDirectoryListing : public DirectoryListing {
23 public: 24 public:
24 enum Response { 25 enum Response {
25 kListDirectory = 0, 26 kListFile = 0,
26 kListFile = 1, 27 kListDirectory = 1,
27 kListError = 2, 28 kListError = 2,
28 kListDone = 3 29 kListDone = 3
29 }; 30 };
30 31
31 explicit AsyncDirectoryListing(Dart_Port response_port) 32 explicit AsyncDirectoryListing(Dart_Port response_port)
32 : response_port_(response_port) {} 33 : response_port_(response_port) {}
33 virtual ~AsyncDirectoryListing() {} 34 virtual ~AsyncDirectoryListing() {}
34 virtual bool HandleDirectory(char* dir_name); 35 virtual bool HandleDirectory(char* dir_name);
35 virtual bool HandleFile(char* file_name); 36 virtual bool HandleFile(char* file_name);
36 virtual bool HandleError(const char* dir_name); 37 virtual bool HandleError(const char* dir_name);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 DirectoryListing* listing); 93 DirectoryListing* listing);
93 static ExistsResult Exists(const char* path); 94 static ExistsResult Exists(const char* path);
94 static char* Current(); 95 static char* Current();
95 static bool Create(const char* path); 96 static bool Create(const char* path);
96 static char* CreateTemp(const char* const_template); 97 static char* CreateTemp(const char* const_template);
97 static bool Delete(const char* path, bool recursive); 98 static bool Delete(const char* path, bool recursive);
98 static bool Rename(const char* path, const char* new_path); 99 static bool Rename(const char* path, const char* new_path);
99 static Dart_Port GetServicePort(); 100 static Dart_Port GetServicePort();
100 101
101 private: 102 private:
102 static dart::Mutex mutex_; 103 static NativeService directory_service_;
103 static int service_ports_size_;
104 static Dart_Port* service_ports_;
105 static int service_ports_index_;
106 104
107 DISALLOW_ALLOCATION(); 105 DISALLOW_ALLOCATION();
108 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory); 106 DISALLOW_IMPLICIT_CONSTRUCTORS(Directory);
109 }; 107 };
110 108
111 109
112 #endif // BIN_DIRECTORY_H_ 110 #endif // BIN_DIRECTORY_H_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_impl_sources.gypi ('k') | runtime/bin/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698