| 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_DARTUTILS_H_ | 5 #ifndef BIN_DARTUTILS_H_ |
| 6 #define BIN_DARTUTILS_H_ | 6 #define BIN_DARTUTILS_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 static void ReadFile(const uint8_t** data, intptr_t* file_len, void* stream); | 115 static void ReadFile(const uint8_t** data, intptr_t* file_len, void* stream); |
| 116 static void WriteFile(const void* buffer, intptr_t num_bytes, void* stream); | 116 static void WriteFile(const void* buffer, intptr_t num_bytes, void* stream); |
| 117 static void CloseFile(void* stream); | 117 static void CloseFile(void* stream); |
| 118 static Dart_Handle ReadStringFromFile(const char* filename); | 118 static Dart_Handle ReadStringFromFile(const char* filename); |
| 119 static Dart_Handle ReadStringFromHttp(const char* filename); | 119 static Dart_Handle ReadStringFromHttp(const char* filename); |
| 120 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, | 120 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, |
| 121 Dart_Handle library, | 121 Dart_Handle library, |
| 122 Dart_Handle url); | 122 Dart_Handle url); |
| 123 static Dart_Handle LoadScript(const char* script_uri, | 123 static Dart_Handle LoadScript(const char* script_uri, |
| 124 Dart_Handle builtin_lib); | 124 Dart_Handle builtin_lib); |
| 125 static Dart_Handle LoadScriptHttp(Dart_Handle script_uri, | 125 static Dart_Handle LoadScriptHttp(Dart_Handle uri, |
| 126 Dart_Handle builtin_lib); | 126 Dart_Handle builtin_lib); |
| 127 static Dart_Handle LoadSource(CommandLineOptions* url_mapping, | 127 static Dart_Handle LoadSource(CommandLineOptions* url_mapping, |
| 128 Dart_Handle library, | 128 Dart_Handle library, |
| 129 Dart_Handle url, | 129 Dart_Handle url, |
| 130 Dart_LibraryTag tag, | 130 Dart_LibraryTag tag, |
| 131 const char* filename); | 131 const char* filename); |
| 132 static Dart_Handle PrepareForScriptLoading(const char* package_root, | 132 static Dart_Handle PrepareForScriptLoading(const char* package_root, |
| 133 Dart_Handle builtin_lib); | 133 Dart_Handle builtin_lib); |
| 134 | 134 |
| 135 static bool PostNull(Dart_Port port_id); | 135 static bool PostNull(Dart_Port port_id); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 // Create a new Dart InternalError object with the provided message. | 158 // Create a new Dart InternalError object with the provided message. |
| 159 static Dart_Handle NewInternalError(const char* message); | 159 static Dart_Handle NewInternalError(const char* message); |
| 160 | 160 |
| 161 static void SetOriginalWorkingDirectory(); | 161 static void SetOriginalWorkingDirectory(); |
| 162 | 162 |
| 163 static const char* MapLibraryUrl(CommandLineOptions* url_mapping, | 163 static const char* MapLibraryUrl(CommandLineOptions* url_mapping, |
| 164 const char* url_string); | 164 const char* url_string); |
| 165 | 165 |
| 166 static Dart_Handle SetWorkingDirectory(Dart_Handle builtin_lib); |
| 167 |
| 166 static Dart_Handle ResolveScriptUri(Dart_Handle script_uri, | 168 static Dart_Handle ResolveScriptUri(Dart_Handle script_uri, |
| 167 Dart_Handle builtin_lib); | 169 Dart_Handle builtin_lib); |
| 168 | 170 |
| 169 static Dart_Handle FilePathFromUri(Dart_Handle script_uri, | 171 static Dart_Handle FilePathFromUri(Dart_Handle script_uri, |
| 170 Dart_Handle builtin_lib); | 172 Dart_Handle builtin_lib); |
| 171 | 173 |
| 174 static Dart_Handle PathFromUri(Dart_Handle script_uri, |
| 175 Dart_Handle builtin_lib); |
| 176 |
| 177 static Dart_Handle HostFromUri(Dart_Handle script_uri, |
| 178 Dart_Handle builtin_lib); |
| 179 |
| 180 static Dart_Handle PortFromUri(Dart_Handle script_uri, |
| 181 Dart_Handle builtin_lib); |
| 182 |
| 172 static Dart_Handle ResolveUri(Dart_Handle library_url, | 183 static Dart_Handle ResolveUri(Dart_Handle library_url, |
| 173 Dart_Handle url, | 184 Dart_Handle url, |
| 174 Dart_Handle builtin_lib); | 185 Dart_Handle builtin_lib); |
| 175 | 186 |
| 176 // Sniffs the specified text_buffer to see if it contains the magic number | 187 // Sniffs the specified text_buffer to see if it contains the magic number |
| 177 // representing a script snapshot. If the text_buffer is a script snapshot | 188 // representing a script snapshot. If the text_buffer is a script snapshot |
| 178 // the return value is an updated pointer to the text_buffer pointing past | 189 // the return value is an updated pointer to the text_buffer pointing past |
| 179 // the magic number value. The 'buffer_len' parameter is also appropriately | 190 // the magic number value. The 'buffer_len' parameter is also appropriately |
| 180 // adjusted. | 191 // adjusted. |
| 181 static const uint8_t* SniffForMagicNumber(const uint8_t* text_buffer, | 192 static const uint8_t* SniffForMagicNumber(const uint8_t* text_buffer, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 } | 519 } |
| 509 | 520 |
| 510 private: | 521 private: |
| 511 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); | 522 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); |
| 512 }; | 523 }; |
| 513 | 524 |
| 514 } // namespace bin | 525 } // namespace bin |
| 515 } // namespace dart | 526 } // namespace dart |
| 516 | 527 |
| 517 #endif // BIN_DARTUTILS_H_ | 528 #endif // BIN_DARTUTILS_H_ |
| OLD | NEW |