| 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_FILE_H_ | 5 #ifndef BIN_FILE_H_ |
| 6 #define BIN_FILE_H_ | 6 #define BIN_FILE_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| 11 #include <sys/types.h> | 11 #include <sys/types.h> |
| 12 | 12 |
| 13 #include "bin/builtin.h" | 13 #include "bin/builtin.h" |
| 14 #include "bin/dartutils.h" | 14 #include "bin/dartutils.h" |
| 15 #include "bin/native_service.h" |
| 15 #include "platform/globals.h" | 16 #include "platform/globals.h" |
| 16 #include "platform/thread.h" | 17 #include "platform/thread.h" |
| 17 | 18 |
| 18 // Forward declaration. | 19 // Forward declaration. |
| 19 class FileHandle; | 20 class FileHandle; |
| 20 | 21 |
| 21 class File { | 22 class File { |
| 22 public: | 23 public: |
| 23 enum FileOpenMode { | 24 enum FileOpenMode { |
| 24 kRead = 0, | 25 kRead = 0, |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 132 |
| 132 private: | 133 private: |
| 133 explicit File(FileHandle* handle) : handle_(handle) { } | 134 explicit File(FileHandle* handle) : handle_(handle) { } |
| 134 void Close(); | 135 void Close(); |
| 135 | 136 |
| 136 static const int kClosedFd = -1; | 137 static const int kClosedFd = -1; |
| 137 | 138 |
| 138 // FileHandle is an OS specific class which stores data about the file. | 139 // FileHandle is an OS specific class which stores data about the file. |
| 139 FileHandle* handle_; // OS specific handle for the file. | 140 FileHandle* handle_; // OS specific handle for the file. |
| 140 | 141 |
| 141 static dart::Mutex mutex_; | 142 static NativeService file_service_; |
| 142 static int service_ports_size_; | |
| 143 static Dart_Port* service_ports_; | |
| 144 static int service_ports_index_; | |
| 145 | 143 |
| 146 DISALLOW_COPY_AND_ASSIGN(File); | 144 DISALLOW_COPY_AND_ASSIGN(File); |
| 147 }; | 145 }; |
| 148 | 146 |
| 149 #endif // BIN_FILE_H_ | 147 #endif // BIN_FILE_H_ |
| OLD | NEW |