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

Unified Diff: runtime/bin/extensions.cc

Issue 11308170: Deal with extension loading from packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix null checks Created 8 years, 1 month 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
« no previous file with comments | « runtime/bin/builtin.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/extensions.cc
diff --git a/runtime/bin/extensions.cc b/runtime/bin/extensions.cc
index 244a63109f199d50da7e67b3795bd0dd87ca0878..d8b13f9d33b02eafca530dc83b2c4c863dbbd964 100644
--- a/runtime/bin/extensions.cc
+++ b/runtime/bin/extensions.cc
@@ -15,17 +15,18 @@
Dart_Handle Extensions::LoadExtension(const char* extension_url,
Dart_Handle parent_library) {
char* library_path = strdup(extension_url);
- if (!library_path || !File::IsAbsolutePath(library_path)) {
- free(library_path);
- return Dart_Error("unexpected error in library path");
+
+ if (library_path == NULL) {
+ return Dart_Error("Out of memory in LoadExtension");
}
+
// Extract the path and the extension name from the url.
char* last_path_separator = strrchr(library_path, '/');
char* extension_name = last_path_separator + 1;
*last_path_separator = '\0'; // Terminate library_path at last separator.
void* library_handle = LoadExtensionLibrary(library_path, extension_name);
- if (!library_handle) {
+ if (library_handle == NULL) {
free(library_path);
return Dart_Error("cannot find extension library");
}
« no previous file with comments | « runtime/bin/builtin.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698