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

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: Fix SDK dir for SDK mojoms in Modular 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
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",
41 "/core/handle_patch.dart",
42 "/core/handle_watcher_patch.dart",
43 "/core/message_pipe_patch.dart",
44 NULL, 40 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", true, Builtin::NativeSymbol, Builtin::NativeLookup,
51 nullptr, nullptr }, 47 nullptr, nullptr },
52 {"dart:mojo.bindings", false, nullptr, nullptr, 48 {"dart:mojo.internal", true, MojoNativeSymbol, MojoNativeLookup,
53 nullptr, nullptr }, 49 "dart:mojo.internal-patch", mojo_core_patch_resource_names_ },
54 {"dart:mojo.core", true, MojoNativeSymbol, MojoNativeLookup,
55 "dart:mojo.core-patch", mojo_core_patch_resource_names_ },
56 }; 50 };
57 51
58 uint8_t Builtin::snapshot_magic_number[] = {0xf5, 0xf5, 0xdc, 0xdc}; 52 uint8_t Builtin::snapshot_magic_number[] = {0xf5, 0xf5, 0xdc, 0xdc};
59 53
60 Dart_Handle Builtin::NewError(const char* format, ...) { 54 Dart_Handle Builtin::NewError(const char* format, ...) {
61 va_list args; 55 va_list args;
62 va_start(args, format); 56 va_start(args, format);
63 intptr_t len = vsnprintf(nullptr, 0, format, args); 57 intptr_t len = vsnprintf(nullptr, 0, format, args);
64 va_end(args); 58 va_end(args);
65 59
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 if (builtin_libraries_[id].patch_url_ != nullptr) { 118 if (builtin_libraries_[id].patch_url_ != nullptr) {
125 DCHECK(builtin_libraries_[id].patch_resources_ != nullptr); 119 DCHECK(builtin_libraries_[id].patch_resources_ != nullptr);
126 LoadPatchFiles(library, 120 LoadPatchFiles(library,
127 builtin_libraries_[id].patch_url_, 121 builtin_libraries_[id].patch_url_,
128 builtin_libraries_[id].patch_resources_); 122 builtin_libraries_[id].patch_resources_);
129 } 123 }
130 } 124 }
131 125
132 } // namespace dart 126 } // namespace dart
133 } // namespace mojo 127 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698