| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_DART_EMBEDDER_BUILTIN_H_ | 5 #ifndef MOJO_DART_EMBEDDER_BUILTIN_H_ |
| 6 #define MOJO_DART_EMBEDDER_BUILTIN_H_ | 6 #define MOJO_DART_EMBEDDER_BUILTIN_H_ |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "dart/runtime/include/dart_api.h" | 13 #include "dart/runtime/include/dart_api.h" |
| 14 | 14 |
| 15 namespace mojo { | 15 namespace mojo { |
| 16 namespace dart { | 16 namespace dart { |
| 17 | 17 |
| 18 #define REGISTER_FUNCTION(name, count) \ | 18 #define REGISTER_FUNCTION(name, count) \ |
| 19 { "" #name, name, count }, | 19 { "" #name, name, count }, |
| 20 #define DECLARE_FUNCTION(name, count) \ | 20 #define DECLARE_FUNCTION(name, count) \ |
| 21 extern void name(Dart_NativeArguments args); | 21 extern void name(Dart_NativeArguments args); |
| 22 | 22 |
| 23 class Builtin { | 23 class Builtin { |
| 24 public: | 24 public: |
| 25 // Note: Changes to this enum should be accompanied with changes to | 25 // Note: Changes to this enum should be accompanied with changes to |
| 26 // the builtin_libraries_ array in builtin.cc. | 26 // the builtin_libraries_ array in builtin.cc. |
| 27 enum BuiltinLibraryId { | 27 enum BuiltinLibraryId { |
| 28 kBuiltinLibrary = 0, | 28 kBuiltinLibrary = 0, |
| 29 kMojoBindingsLibrary = 1, | 29 kMojoInternalLibrary = 1, |
| 30 kMojoCoreLibrary = 2, | |
| 31 kInvalidLibrary, | 30 kInvalidLibrary, |
| 32 }; | 31 }; |
| 33 | 32 |
| 34 static uint8_t snapshot_magic_number[4]; | 33 static uint8_t snapshot_magic_number[4]; |
| 35 | 34 |
| 36 // Return the library specified in 'id'. | 35 // Return the library specified in 'id'. |
| 37 static Dart_Handle GetLibrary(BuiltinLibraryId id); | 36 static Dart_Handle GetLibrary(BuiltinLibraryId id); |
| 38 | 37 |
| 39 // Prepare the library specified in 'id'. Preparation includes: | 38 // Prepare the library specified in 'id'. Preparation includes: |
| 40 // 1) Setting the native resolver (if any). | 39 // 1) Setting the native resolver (if any). |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 static builtin_lib_props builtin_libraries_[]; | 73 static builtin_lib_props builtin_libraries_[]; |
| 75 | 74 |
| 76 static const char* mojo_core_patch_resource_names_[]; | 75 static const char* mojo_core_patch_resource_names_[]; |
| 77 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin); | 76 DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin); |
| 78 }; | 77 }; |
| 79 | 78 |
| 80 } // namespace dart | 79 } // namespace dart |
| 81 } // namespace mojo | 80 } // namespace mojo |
| 82 | 81 |
| 83 #endif // MOJO_DART_EMBEDDER_BUILTIN_H_ | 82 #endif // MOJO_DART_EMBEDDER_BUILTIN_H_ |
| OLD | NEW |