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

Unified Diff: runtime/bin/main.cc

Issue 9430051: Add native extensions to the Dart shell, on the linux platform. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix Windows bugs Created 8 years, 10 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/extensions_win.cc ('k') | runtime/bin/test_extension_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 09040450188a265484e71e16e96a86bf078a87e9..b814bcb71fca65571cd37f371cf7f6ada28fcfa8 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -12,6 +12,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
#include "bin/eventhandler.h"
+#include "bin/extensions.h"
#include "bin/file.h"
#include "bin/platform.h"
#include "bin/process.h"
@@ -257,10 +258,11 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
return Dart_Error("accessing url characters failed");
}
bool is_dart_scheme_url = DartUtils::IsDartSchemeURL(url_string);
+ bool is_dart_extension_url = DartUtils::IsDartExtensionSchemeURL(url_string);
if (tag == kCanonicalizeUrl) {
// If this is a Dart Scheme URL then it is not modified as it will be
// handled by the VM internally.
- if (is_dart_scheme_url) {
+ if (is_dart_scheme_url || is_dart_extension_url) {
return url;
}
// Create a canonical path based on the including library and current url.
@@ -280,6 +282,11 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
} else {
return Dart_Error("Do not know how to load '%s'", url_string);
}
+ } else if (is_dart_extension_url) {
+ if (tag != kImportTag) {
+ return Dart_Error("Dart extensions must use import: '%s'", url_string);
+ }
+ return Extensions::LoadExtension(url_string, library);
}
result = DartUtils::LoadSource(NULL,
library,
« no previous file with comments | « runtime/bin/extensions_win.cc ('k') | runtime/bin/test_extension_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698