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 #include <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "base/i18n/icu_util.h" | 7 #include "base/i18n/icu_util.h" |
8 #include "dart/runtime/include/dart_api.h" | 8 #include "dart/runtime/include/dart_api.h" |
9 #include "mojo/dart/embedder/builtin.h" | 9 #include "mojo/dart/embedder/builtin.h" |
10 #include "mojo/dart/embedder/mojo_natives.h" | 10 #include "mojo/dart/embedder/mojo_natives.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 *resource = reinterpret_cast<const uint8_t*>(entry.resource_); | 29 *resource = reinterpret_cast<const uint8_t*>(entry.resource_); |
30 DCHECK(entry.length_ > 0); | 30 DCHECK(entry.length_ > 0); |
31 return entry.length_; | 31 return entry.length_; |
32 } | 32 } |
33 } | 33 } |
34 *resource = NULL; | 34 *resource = NULL; |
35 return -1; | 35 return -1; |
36 } | 36 } |
37 | 37 |
38 const char* Builtin::mojo_core_patch_resource_names_[] = { | 38 const char* Builtin::mojo_core_patch_resource_names_[] = { |
39 "/core/buffer_patch.dart", | 39 "/core/natives_patch.dart", |
40 "/core/data_pipe_patch.dart", | 40 NULL, |
41 "/core/handle_patch.dart", | |
42 "/core/handle_watcher_patch.dart", | |
43 "/core/message_pipe_patch.dart", | |
44 NULL, | |
45 }; | 41 }; |
46 | 42 |
47 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = { | 43 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = { |
48 /* { url_, has_natives_, native_symbol_, native_resolver_, | 44 /* { url_, has_natives_, native_symbol_, native_resolver_, |
49 patch_url_, patch_paths_ } */ | 45 patch_url_, patch_paths_ } */ |
50 {"dart:mojo.builtin", true, Builtin::NativeSymbol, Builtin::NativeLookup, | 46 {"dart:mojo.builtin", |
51 nullptr, nullptr }, | 47 true, |
52 {"dart:mojo.bindings", false, nullptr, nullptr, | 48 Builtin::NativeSymbol, |
53 nullptr, nullptr }, | 49 Builtin::NativeLookup, |
54 {"dart:mojo.core", true, MojoNativeSymbol, MojoNativeLookup, | 50 nullptr, |
55 "dart:mojo.core-patch", mojo_core_patch_resource_names_ }, | 51 nullptr}, |
| 52 {"dart:mojo.internal", |
| 53 true, |
| 54 MojoNativeSymbol, |
| 55 MojoNativeLookup, |
| 56 "dart:mojo.internal-patch", |
| 57 mojo_core_patch_resource_names_}, |
56 }; | 58 }; |
57 | 59 |
58 uint8_t Builtin::snapshot_magic_number[] = {0xf5, 0xf5, 0xdc, 0xdc}; | 60 uint8_t Builtin::snapshot_magic_number[] = {0xf5, 0xf5, 0xdc, 0xdc}; |
59 | 61 |
60 Dart_Handle Builtin::NewError(const char* format, ...) { | 62 Dart_Handle Builtin::NewError(const char* format, ...) { |
61 va_list args; | 63 va_list args; |
62 va_start(args, format); | 64 va_start(args, format); |
63 intptr_t len = vsnprintf(nullptr, 0, format, args); | 65 intptr_t len = vsnprintf(nullptr, 0, format, args); |
64 va_end(args); | 66 va_end(args); |
65 | 67 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 if (builtin_libraries_[id].patch_url_ != nullptr) { | 126 if (builtin_libraries_[id].patch_url_ != nullptr) { |
125 DCHECK(builtin_libraries_[id].patch_resources_ != nullptr); | 127 DCHECK(builtin_libraries_[id].patch_resources_ != nullptr); |
126 LoadPatchFiles(library, | 128 LoadPatchFiles(library, |
127 builtin_libraries_[id].patch_url_, | 129 builtin_libraries_[id].patch_url_, |
128 builtin_libraries_[id].patch_resources_); | 130 builtin_libraries_[id].patch_resources_); |
129 } | 131 } |
130 } | 132 } |
131 | 133 |
132 } // namespace dart | 134 } // namespace dart |
133 } // namespace mojo | 135 } // namespace mojo |
OLD | NEW |