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

Unified Diff: runtime/bin/builtin.cc

Issue 11337019: Use patching for dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/builtin.cc
diff --git a/runtime/bin/builtin.cc b/runtime/bin/builtin.cc
index 31126280a02c5e3152a382d55ced559fa3434fcf..0148a781c58861f4dae5725be1850175a9ccc0eb 100644
--- a/runtime/bin/builtin.cc
+++ b/runtime/bin/builtin.cc
@@ -11,13 +11,14 @@
Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
- /* url_ source_ has_natives_ */
- { DartUtils::kBuiltinLibURL, builtin_source_, true },
- { DartUtils::kJsonLibURL, json_source_, false },
- { DartUtils::kUriLibURL, uri_source_, false },
- { DartUtils::kCryptoLibURL, crypto_source_, false },
- { DartUtils::kIOLibURL, io_source_, true },
- { DartUtils::kUtfLibURL, utf_source_, false }
+ /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
+ { DartUtils::kBuiltinLibURL, builtin_source_, NULL, NULL, true },
+ { DartUtils::kJsonLibURL, json_source_, NULL, NULL, false },
+ { DartUtils::kUriLibURL, uri_source_, NULL, NULL, false },
+ { DartUtils::kCryptoLibURL, crypto_source_, NULL, NULL, false },
+ { DartUtils::kIOLibURL, io_source_,
+ DartUtils::kIOLibPatchURL, io_patch_, true },
+ { DartUtils::kUtfLibURL, utf_source_, NULL, NULL, false }
};
@@ -46,6 +47,13 @@ Dart_Handle Builtin::LoadAndCheckLibrary(BuiltinLibraryId id) {
// Setup the native resolver for built in library functions.
DART_CHECK_VALID(Dart_SetNativeResolver(library, NativeLookup));
}
+ if (builtin_libraries_[id].patch_url_ != NULL) {
+ ASSERT(builtin_libraries_[id].patch_source_ != NULL);
+ Dart_Handle patch_url = Dart_NewString(builtin_libraries_[id].patch_url_);
+ Dart_Handle patch_source =
+ Dart_NewString(builtin_libraries_[id].patch_source_);
+ DART_CHECK_VALID(Dart_LoadPatch(library, patch_url, patch_source));
+ }
}
DART_CHECK_VALID(library);
return library;

Powered by Google App Engine
This is Rietveld 408576698