| 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_BUILTIN_H_ | 5 #ifndef BIN_BUILTIN_H_ |
| 6 #define BIN_BUILTIN_H_ | 6 #define BIN_BUILTIN_H_ |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 { ""#name, FUNCTION_NAME(name), count }, | 21 { ""#name, FUNCTION_NAME(name), count }, |
| 22 #define DECLARE_FUNCTION(name, count) \ | 22 #define DECLARE_FUNCTION(name, count) \ |
| 23 extern void FUNCTION_NAME(name)(Dart_NativeArguments args); | 23 extern void FUNCTION_NAME(name)(Dart_NativeArguments args); |
| 24 | 24 |
| 25 | 25 |
| 26 class Builtin { | 26 class Builtin { |
| 27 public: | 27 public: |
| 28 // Note: Changes to this enum should be accompanied with changes to | 28 // Note: Changes to this enum should be accompanied with changes to |
| 29 // the builtin_libraries_ array in builtin.cc and builtin_nolib.cc. | 29 // the builtin_libraries_ array in builtin.cc and builtin_nolib.cc. |
| 30 enum BuiltinLibraryId { | 30 enum BuiltinLibraryId { |
| 31 kInvalidLibrary = -1, |
| 31 kBuiltinLibrary = 0, | 32 kBuiltinLibrary = 0, |
| 32 kIOLibrary, | 33 kIOLibrary |
| 33 #if defined(DART_NO_SNAPSHOT) | |
| 34 // Only include these libraries in the dart_bootstrap case for now. | |
| 35 kHTMLLibrary, | |
| 36 kHTMLCommonLibrary, | |
| 37 kJSLibrary, | |
| 38 kBlinkLibrary, | |
| 39 kIndexedDbLibrary, | |
| 40 kCachedPatchesLibrary, | |
| 41 kWebGlLibrary, | |
| 42 kMetaDataLibrary, | |
| 43 kWebSqlLibrary, | |
| 44 kSvgLibrary, | |
| 45 kWebAudioLibrary, | |
| 46 #endif // defined(DART_NO_SNAPSHOT) | |
| 47 kInvalidLibrary, | |
| 48 }; | 34 }; |
| 49 | 35 |
| 50 // Get source corresponding to built in library specified in 'id'. | 36 // Get source corresponding to built in library specified in 'id'. |
| 51 static Dart_Handle Source(BuiltinLibraryId id); | 37 static Dart_Handle Source(BuiltinLibraryId id); |
| 52 | 38 |
| 53 // Get source of part file specified in 'uri'. | 39 // Get source of part file specified in 'uri'. |
| 54 static Dart_Handle PartSource(BuiltinLibraryId id, const char* part_uri); | 40 static Dart_Handle PartSource(BuiltinLibraryId id, const char* part_uri); |
| 55 | 41 |
| 56 // Setup native resolver method built in library specified in 'id'. | 42 // Setup native resolver method built in library specified in 'id'. |
| 57 static void SetNativeResolver(BuiltinLibraryId id); | 43 static void SetNativeResolver(BuiltinLibraryId id); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 86 static const char* blink_source_paths_[]; | 72 static const char* blink_source_paths_[]; |
| 87 static const char* indexeddb_source_paths_[]; | 73 static const char* indexeddb_source_paths_[]; |
| 88 static const char* cached_patches_source_paths_[]; | 74 static const char* cached_patches_source_paths_[]; |
| 89 static const char* web_gl_source_paths_[]; | 75 static const char* web_gl_source_paths_[]; |
| 90 static const char* metadata_source_paths_[]; | 76 static const char* metadata_source_paths_[]; |
| 91 static const char* websql_source_paths_[]; | 77 static const char* websql_source_paths_[]; |
| 92 static const char* svg_source_paths_[]; | 78 static const char* svg_source_paths_[]; |
| 93 static const char* webaudio_source_paths_[]; | 79 static const char* webaudio_source_paths_[]; |
| 94 | 80 |
| 95 static Dart_Port load_port_; | 81 static Dart_Port load_port_; |
| 82 static const int num_libs_; |
| 96 | 83 |
| 97 typedef struct { | 84 typedef struct { |
| 98 const char* url_; | 85 const char* url_; |
| 99 const char** source_paths_; | 86 const char** source_paths_; |
| 100 const char* patch_url_; | 87 const char* patch_url_; |
| 101 const char** patch_paths_; | 88 const char** patch_paths_; |
| 102 bool has_natives_; | 89 bool has_natives_; |
| 103 } builtin_lib_props; | 90 } builtin_lib_props; |
| 104 static builtin_lib_props builtin_libraries_[]; | 91 static builtin_lib_props builtin_libraries_[]; |
| 105 | 92 |
| 106 DISALLOW_ALLOCATION(); | 93 DISALLOW_ALLOCATION(); |
| 107 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin); | 94 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin); |
| 108 }; | 95 }; |
| 109 | 96 |
| 110 } // namespace bin | 97 } // namespace bin |
| 111 } // namespace dart | 98 } // namespace dart |
| 112 | 99 |
| 113 #endif // BIN_BUILTIN_H_ | 100 #endif // BIN_BUILTIN_H_ |
| OLD | NEW |