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

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

Issue 2073173002: Use the new loader mechanism to resolve URIs and load script files in gen_snapshot. This should all… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address issues that were found while testing with the flutter engine. Created 4 years, 6 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/dartutils.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_DARTUTILS_H_ 5 #ifndef BIN_DARTUTILS_H_
6 #define BIN_DARTUTILS_H_ 6 #define BIN_DARTUTILS_H_
7 7
8 #include "bin/isolate_data.h" 8 #include "bin/isolate_data.h"
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_native_api.h" 10 #include "include/dart_native_api.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 static Dart_Handle NewInternalError(const char* message); 187 static Dart_Handle NewInternalError(const char* message);
188 188
189 static Dart_Handle BuiltinLib() { 189 static Dart_Handle BuiltinLib() {
190 IsolateData* isolate_data = 190 IsolateData* isolate_data =
191 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); 191 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
192 return isolate_data->builtin_lib(); 192 return isolate_data->builtin_lib();
193 } 193 }
194 194
195 static bool SetOriginalWorkingDirectory(); 195 static bool SetOriginalWorkingDirectory();
196 196
197 static const char* MapLibraryUrl(CommandLineOptions* url_mapping, 197 static const char* MapLibraryUrl(const char* url_string);
198 const char* url_string);
199 198
200 static Dart_Handle ResolveUriInWorkingDirectory(Dart_Handle script_uri);
201 static Dart_Handle FilePathFromUri(Dart_Handle script_uri);
202 static Dart_Handle ResolveUri(Dart_Handle library_url, Dart_Handle url);
203 static Dart_Handle ResolveScript(Dart_Handle url); 199 static Dart_Handle ResolveScript(Dart_Handle url);
204 200
205 // Sniffs the specified text_buffer to see if it contains the magic number 201 // Sniffs the specified text_buffer to see if it contains the magic number
206 // representing a script snapshot. If the text_buffer is a script snapshot 202 // representing a script snapshot. If the text_buffer is a script snapshot
207 // the return value is an updated pointer to the text_buffer pointing past 203 // the return value is an updated pointer to the text_buffer pointing past
208 // the magic number value. The 'buffer_len' parameter is also appropriately 204 // the magic number value. The 'buffer_len' parameter is also appropriately
209 // adjusted. 205 // adjusted.
210 static const uint8_t* SniffForMagicNumber(const uint8_t* text_buffer, 206 static const uint8_t* SniffForMagicNumber(const uint8_t* text_buffer,
211 intptr_t* buffer_len, 207 intptr_t* buffer_len,
212 bool* is_snapshot); 208 bool* is_snapshot);
213 209
214 // Write a magic number to indicate a script snapshot file. 210 // Write a magic number to indicate a script snapshot file.
215 static void WriteMagicNumber(File* file); 211 static void WriteMagicNumber(File* file);
216 212
217 // Global state that stores the original working directory.. 213 // Global state that stores the original working directory..
218 static const char* original_working_directory; 214 static const char* original_working_directory;
219 215
216 // Global state that captures the URL mappings specified on the command line.
217 static CommandLineOptions* url_mapping;
218
220 static const char* const kDartScheme; 219 static const char* const kDartScheme;
221 static const char* const kDartExtensionScheme; 220 static const char* const kDartExtensionScheme;
222 static const char* const kAsyncLibURL; 221 static const char* const kAsyncLibURL;
223 static const char* const kBuiltinLibURL; 222 static const char* const kBuiltinLibURL;
224 static const char* const kCoreLibURL; 223 static const char* const kCoreLibURL;
225 static const char* const kInternalLibURL; 224 static const char* const kInternalLibURL;
226 static const char* const kIsolateLibURL; 225 static const char* const kIsolateLibURL;
227 static const char* const kIOLibURL; 226 static const char* const kIOLibURL;
228 static const char* const kIOLibPatchURL; 227 static const char* const kIOLibPatchURL;
229 static const char* const kUriLibURL; 228 static const char* const kUriLibURL;
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 bool is_typed_data_; 664 bool is_typed_data_;
666 665
667 DISALLOW_ALLOCATION(); 666 DISALLOW_ALLOCATION();
668 DISALLOW_COPY_AND_ASSIGN(ScopedMemBuffer); 667 DISALLOW_COPY_AND_ASSIGN(ScopedMemBuffer);
669 }; 668 };
670 669
671 } // namespace bin 670 } // namespace bin
672 } // namespace dart 671 } // namespace dart
673 672
674 #endif // BIN_DARTUTILS_H_ 673 #endif // BIN_DARTUTILS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/dartutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698