Version 1.18.0-dev.4.1
Cherry-pick badabcc53a3256547e6365326798f808d39a343c to dev
Cherry-pick 05c1eac65d8678bc1f9fa688d0e119f56a3d0f90 to dev
Cherry-pick 31b32c783833fbe9a6f4ee0909d27925f8459b26 to dev
Cherry-pick 373121fb71b89422c20776c4c17a1960eb8b99c0 to dev
Cherry-pick ed75eabb7bc269df7174018aea78cc6e9ed65c25 to dev
Cherry-pick 7f879e1c4b517e092971eeacb0b3ec83eec3b610 to dev
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index 8e24f67..19150a7 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -16,6 +16,8 @@
// Development flag.
static bool trace_loader = false;
+// Keep in sync with loader.dart.
+static const intptr_t _Dart_kImportExtension = 9;
Loader::Loader(IsolateData* isolate_data)
: port_(ILLEGAL_PORT),
@@ -152,6 +154,29 @@
}
+void Loader::SendImportExtensionRequest(Dart_Handle url,
+ Dart_Handle library_url) {
+ // This port delivers loading messages to the service isolate.
+ Dart_Port loader_port = Builtin::LoadPort();
+ ASSERT(loader_port != ILLEGAL_PORT);
+
+
+ Dart_Handle request = Dart_NewList(6);
+ Dart_ListSetAt(request, 0, trace_loader ? Dart_True() : Dart_False());
+ Dart_ListSetAt(request, 1, Dart_NewInteger(Dart_GetMainPortId()));
+ Dart_ListSetAt(request, 2, Dart_NewInteger(_Dart_kImportExtension));
+ Dart_ListSetAt(request, 3, Dart_NewSendPort(port_));
+
+ Dart_ListSetAt(request, 4, url);
+ Dart_ListSetAt(request, 5, library_url);
+
+ if (Dart_Post(loader_port, request)) {
+ MonitorLocker ml(monitor_);
+ pending_operations_++;
+ }
+}
+
+
// Forward a request from the tag handler to the service isolate.
void Loader::SendRequest(Dart_LibraryTag tag,
Dart_Handle url,
@@ -229,6 +254,15 @@
}
+static bool IsWindowsHost() {
+#if defined(TARGET_OS_WINDOWS)
+ return true;
+#else // defined(TARGET_OS_WINDOWS)
+ return false;
+#endif // defined(TARGET_OS_WINDOWS)
+}
+
+
bool Loader::ProcessResultLocked(Loader* loader, Loader::IOResult* result) {
// We have to copy everything we care about out of |result| because after
// dropping the lock below |result| may no longer valid.
@@ -258,6 +292,30 @@
}
+ if (result->tag == _Dart_kImportExtension) {
+ ASSERT(library_uri != Dart_Null());
+ Dart_Handle library = Dart_LookupLibrary(library_uri);
+ ASSERT(!Dart_IsError(library));
+ const char* lib_path_str = reinterpret_cast<const char*>(result->payload);
+ const char* extension_uri = reinterpret_cast<const char*>(result->uri);
+ const char* extension_path = DartUtils::RemoveScheme(extension_uri);
+ if (strchr(extension_path, '/') != NULL ||
+ (IsWindowsHost() && strchr(extension_path, '\\') != NULL)) {
+ loader->error_ = DartUtils::NewError(
+ "Relative paths for dart extensions are not supported: '%s'",
+ extension_path);
+ return false;
+ }
+ Dart_Handle result = Extensions::LoadExtension(lib_path_str,
+ extension_path,
+ library);
+ if (Dart_IsError(result)) {
+ loader->error_ = result;
+ return false;
+ }
+ return true;
+ }
+
// Check for payload and load accordingly.
bool is_snapshot = false;
const uint8_t* payload = result->payload;
@@ -355,15 +413,6 @@
}
-static bool IsWindowsHost() {
-#if defined(TARGET_OS_WINDOWS)
- return true;
-#else // defined(TARGET_OS_WINDOWS)
- return false;
-#endif // defined(TARGET_OS_WINDOWS)
-}
-
-
void Loader::InitForSnapshot(const char* snapshot_uri) {
IsolateData* isolate_data =
reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
@@ -465,7 +514,7 @@
}
if (DartUtils::IsDartExtensionSchemeURL(url_string)) {
- // Load a native code shared library to use in a native extension
+ // Handle early error cases for dart-ext: imports.
if (tag != Dart_kImportTag) {
return DartUtils::NewError("Dart extensions must use import: '%s'",
url_string);
@@ -474,19 +523,6 @@
if (Dart_IsError(library_url)) {
return library_url;
}
- Dart_Handle library_file_path = DartUtils::LibraryFilePath(library_url);
- const char* lib_path_str = NULL;
- Dart_StringToCString(library_file_path, &lib_path_str);
- const char* extension_path = DartUtils::RemoveScheme(url_string);
- if (strchr(extension_path, '/') != NULL ||
- (IsWindowsHost() && strchr(extension_path, '\\') != NULL)) {
- return DartUtils::NewError(
- "Relative paths for dart extensions are not supported: '%s'",
- extension_path);
- }
- return Extensions::LoadExtension(lib_path_str,
- extension_path,
- library);
}
IsolateData* isolate_data =
@@ -523,10 +559,15 @@
ASSERT(loader != NULL);
ASSERT(isolate_data->HasLoader());
- loader->SendRequest(tag,
- url,
- (library != Dart_Null()) ?
- Dart_LibraryUrl(library) : Dart_Null());
+ if (DartUtils::IsDartExtensionSchemeURL(url_string)) {
+ loader->SendImportExtensionRequest(url, Dart_LibraryUrl(library));
+ } else {
+ loader->SendRequest(tag,
+ url,
+ (library != Dart_Null()) ?
+ Dart_LibraryUrl(library) : Dart_Null());
+ }
+
if (blocking_call) {
// The outer invocation of the tag handler will block here until all nested
diff --git a/runtime/bin/loader.h b/runtime/bin/loader.h
index 088ce2e..034138e 100644
--- a/runtime/bin/loader.h
+++ b/runtime/bin/loader.h
@@ -82,6 +82,10 @@
const char* working_directory,
const char* root_script_uri);
+ // Send a request for a dart-ext: import to the service isolate.
+ void SendImportExtensionRequest(Dart_Handle url,
+ Dart_Handle library_url);
+
// Send a request from the tag handler to the service isolate.
void SendRequest(Dart_LibraryTag tag,
Dart_Handle url,
diff --git a/runtime/bin/vmservice/loader.dart b/runtime/bin/vmservice/loader.dart
index cb6792b..7686f1c 100644
--- a/runtime/bin/vmservice/loader.dart
+++ b/runtime/bin/vmservice/loader.dart
@@ -339,6 +339,25 @@
sp.send(msg);
}
+// Send a response to the requesting isolate.
+void _sendExtensionImportResponse(SendPort sp,
+ Uri uri,
+ String libraryUrl,
+ String resolvedUri) {
+ var msg = new List(4);
+ int tag = _Dart_kImportExtension;
+ if (resolvedUri == null) {
+ // We could not resolve the dart-ext: uri.
+ tag = -tag;
+ resolvedUri = 'Could not resolve "$uri" from "$libraryUrl"';
+ }
+ msg[0] = tag;
+ msg[1] = uri.toString();
+ msg[2] = libraryUrl;
+ msg[3] = resolvedUri;
+ sp.send(msg);
+}
+
void _loadHttp(SendPort sp,
int tag,
Uri uri,
@@ -880,6 +899,7 @@
const _Dart_kGetPackageRootUri = 6; // Uri of the packages/ directory.
const _Dart_kGetPackageConfigUri = 7; // Uri of the .packages file.
const _Dart_kResolvePackageUri = 8; // Resolve a package: uri.
+const _Dart_kImportExtension = 9; // Import a dart-ext: file.
// External entry point for loader requests.
_processLoadRequest(request) {
@@ -990,6 +1010,57 @@
sp.send(resolvedUri);
});
break;
+ case _Dart_kImportExtension:
+ Uri uri = Uri.parse(request[4]);
+ String libraryUri = request[5];
+ // Strip any filename off of the libraryUri's path.
+ int index = libraryUri.lastIndexOf('/');
+ var path;
+ if (index == -1) {
+ path = './';
+ } else {
+ path = libraryUri.substring(0, index + 1);
+ }
+ var pathUri = Uri.parse(path);
+ switch (pathUri.scheme) {
+ case '':
+ case 'file':
+ _sendExtensionImportResponse(sp, uri, libraryUri,
+ pathUri.toFilePath());
+ break;
+ case 'data':
+ case 'http':
+ case 'https':
+ _sendExtensionImportResponse(sp, uri, libraryUri,
+ pathUri.toString());
+ break;
+ case 'package':
+ // Start package resolution.
+ loaderState._triggerPackageResolution(() {
+ // Attempt to find the fully resolved uri of [path].
+ Uri resolvedUri;
+ try {
+ resolvedUri = loaderState._resolvePackageUri(pathUri);
+ } catch (e, s) {
+ if (traceLoading) {
+ _log("Exception ($e) when resolving package URI: $uri");
+ }
+ resolvedUri = null;
+ }
+ _sendExtensionImportResponse(sp,
+ uri,
+ libraryUri,
+ resolvedUri.toString());
+ });
+ break;
+ default:
+ if (traceLoading) {
+ _log('Unknown scheme (${pathUri.scheme}) in $pathUri.');
+ }
+ _sendExtensionImportResponse(sp, uri, libraryUri, null);
+ break;
+ }
+ break;
default:
_log('Unknown loader request tag=$tag from $isolateId');
}
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index 2a7e664..b178851 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -483,12 +483,14 @@
void disconnect([destination_OR_output, int output, int input]) native;
@DomName('AudioNode.connect')
- void connectNode(AudioNode destination, [int output = 0, int input = 0]) =>
- _connect(destination, output, input);
+ void connectNode(AudioNode destination, [int output = 0, int input = 0]) {
+ _connect(destination, output, input);
+ }
@DomName('AudioNode.connect')
- void connectParam(AudioParam destination, [int output = 0]) =>
- _connect(destination, output);
+ void connectParam(AudioParam destination, [int output = 0]) {
+ _connect(destination, output);
+ }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
diff --git a/sdk/lib/web_audio/dartium/web_audio_dartium.dart b/sdk/lib/web_audio/dartium/web_audio_dartium.dart
index c73b31b..6fd5356 100644
--- a/sdk/lib/web_audio/dartium/web_audio_dartium.dart
+++ b/sdk/lib/web_audio/dartium/web_audio_dartium.dart
@@ -689,12 +689,14 @@
}
@DomName('AudioNode.connect')
- void connectNode(AudioNode destination, [int output = 0, int input = 0]) =>
- _connect(destination, output, input);
+ void connectNode(AudioNode destination, [int output = 0, int input = 0]) {
+ _connect(destination, output, input);
+ }
@DomName('AudioNode.connect')
- void connectParam(AudioParam destination, [int output = 0]) =>
- _connect(destination, output);
+ void connectParam(AudioParam destination, [int output = 0]) {
+ _connect(destination, output);
+ }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
diff --git a/tools/VERSION b/tools/VERSION
index 6fb4f1b..9a83b13 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,4 +28,4 @@
MINOR 18
PATCH 0
PRERELEASE 4
-PRERELEASE_PATCH 0
+PRERELEASE_PATCH 1
diff --git a/tools/deps/dartium.deps/DEPS b/tools/deps/dartium.deps/DEPS
index c526711..a12cdc3 100644
--- a/tools/deps/dartium.deps/DEPS
+++ b/tools/deps/dartium.deps/DEPS
@@ -8,8 +8,8 @@
# Now we need to override some settings and add some new ones.
vars.update({
- "dartium_chromium_commit": "ef7d4ae18c646aea34c07a7ef62de7342c3b8c12",
- "dartium_webkit_commit": "e77699b350f3e76be2d6f4e06af37615d3d6e778",
+ "dartium_chromium_commit": "67a7ba9669f7bb0300ef35085d4e6bb98b1966cc",
+ "dartium_webkit_commit": "d3db7d1b53979ca91cbf8f3117971f49d0fddf13",
"chromium_base_revision": "338390",
# We use mirrors of all github repos to guarantee reproducibility and
diff --git a/tools/dom/templates/html/impl/impl_AudioNode.darttemplate b/tools/dom/templates/html/impl/impl_AudioNode.darttemplate
index 43db4b3..e5ba37a 100644
--- a/tools/dom/templates/html/impl/impl_AudioNode.darttemplate
+++ b/tools/dom/templates/html/impl/impl_AudioNode.darttemplate
@@ -7,10 +7,12 @@
$(ANNOTATIONS)$(NATIVESPEC)class $CLASSNAME$EXTENDS$IMPLEMENTS {
$!MEMBERS
@DomName('AudioNode.connect')
- void connectNode(AudioNode destination, [int output = 0, int input = 0]) =>
- _connect(destination, output, input);
+ void connectNode(AudioNode destination, [int output = 0, int input = 0]) {
+ _connect(destination, output, input);
+ }
@DomName('AudioNode.connect')
- void connectParam(AudioParam destination, [int output = 0]) =>
- _connect(destination, output);
+ void connectParam(AudioParam destination, [int output = 0]) {
+ _connect(destination, output);
+ }
}