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

Unified Diff: runtime/bin/extensions.cc

Issue 10103031: Refactor URI processing of native extensions directive #import("dart-ext:foo"). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 8 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
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/bin/extensions_linux.cc » ('j') | 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 73a9a54f429ca4d4197fc9c7cf661521aa372481..244a63109f199d50da7e67b3795bd0dd87ca0878 100644
--- a/runtime/bin/extensions.cc
+++ b/runtime/bin/extensions.cc
@@ -14,16 +14,7 @@
Dart_Handle Extensions::LoadExtension(const char* extension_url,
Dart_Handle parent_library) {
- ASSERT(DartUtils::IsDartExtensionSchemeURL(extension_url));
- // Make a mutable copy of the extension url, without the "dart:" scheme.
- const char* path_component =
- extension_url + strlen(DartUtils::kDartExtensionScheme);
-#ifdef TARGET_OS_WINDOWS
- // Remove initial '/' from a uri formatted absolute path "/C:/path/to/dll"
- ASSERT(path_component[0] == '/');
- path_component++;
-#endif
- char* library_path = strdup(path_component);
+ char* library_path = strdup(extension_url);
if (!library_path || !File::IsAbsolutePath(library_path)) {
free(library_path);
return Dart_Error("unexpected error in library path");
@@ -39,7 +30,7 @@ Dart_Handle Extensions::LoadExtension(const char* extension_url,
return Dart_Error("cannot find extension library");
}
- const char* strings[3] = { extension_name, "_Init", NULL };
+ const char* strings[] = { extension_name, "_Init", NULL };
char* init_function_name = Concatenate(strings);
typedef Dart_Handle (*InitFunctionType)(Dart_Handle import_map);
InitFunctionType fn = reinterpret_cast<InitFunctionType>(
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/bin/extensions_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698