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

Side by Side Diff: mojo/dart/embedder/builtin.cc

Issue 1027603002: Dart: Removes all but native calls and the handle watcher from the snapshot. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Hoist application interface dependence Created 5 years, 9 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 | « mojo/dart/embedder/builtin.h ('k') | mojo/dart/embedder/builtin.dart » ('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 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
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
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
OLDNEW
« no previous file with comments | « mojo/dart/embedder/builtin.h ('k') | mojo/dart/embedder/builtin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698