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

Unified Diff: pkg/compiler/lib/src/source_file_provider.dart

Issue 1975153002: Support (de)serialization from command-line (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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: pkg/compiler/lib/src/source_file_provider.dart
diff --git a/pkg/compiler/lib/src/source_file_provider.dart b/pkg/compiler/lib/src/source_file_provider.dart
index 7fae6f2dc29c03f43885d2376d5138f70271e4ed..78a5802b0200b7a20ea8be4b6f2ee6c5d6dd729e 100644
--- a/pkg/compiler/lib/src/source_file_provider.dart
+++ b/pkg/compiler/lib/src/source_file_provider.dart
@@ -241,6 +241,7 @@ typedef void MessageCallback(String message);
class RandomAccessFileOutputProvider implements CompilerOutput {
final Uri out;
final Uri sourceMapOut;
+ final Uri serializationTarget;
final MessageCallback onInfo;
final MessageCallback onFailure;
@@ -248,7 +249,7 @@ class RandomAccessFileOutputProvider implements CompilerOutput {
List<String> allOutputFiles = new List<String>();
RandomAccessFileOutputProvider(this.out, this.sourceMapOut,
- {this.onInfo, this.onFailure});
+ {this.onInfo, this.onFailure, this.serializationTarget});
static Uri computePrecompiledUri(Uri out) {
String extension = 'precompiled.js';
@@ -264,7 +265,7 @@ class RandomAccessFileOutputProvider implements CompilerOutput {
EventSink<String> call(String name, String extension) {
return createEventSink(name, extension);
}
-
+
EventSink<String> createEventSink(String name, String extension) {
Uri uri;
bool isPrimaryOutput = false;
@@ -282,9 +283,14 @@ class RandomAccessFileOutputProvider implements CompilerOutput {
" \"Content-Security-Policy: script-src 'self'\"");
} else if (extension == 'js.map' || extension == 'dart.map') {
uri = sourceMapOut;
- } else if (extension == "info.json") {
+ } else if (extension == 'info.json') {
String outName = out.path.substring(out.path.lastIndexOf('/') + 1);
uri = out.resolve('$outName.$extension');
+ } else if (extension == 'data') {
+ if (serializationTarget == null) {
Siggi Cherem (dart-lang) 2016/05/14 01:10:31 what if they specify serializationTarget with a di
Johnni Winther 2016/05/17 12:37:33 [extension] is a bad name; it is more like a 'mime
+ onFailure('Serialization target unspecified.');
+ }
+ uri = serializationTarget;
} else {
onFailure('Unknown extension: $extension');
}

Powered by Google App Engine
This is Rietveld 408576698