Index: runtime/bin/vmservice/resources.dart |
diff --git a/runtime/bin/vmservice/resources.dart b/runtime/bin/vmservice/resources.dart |
index 0930fdc1b9bc69881688b9c32bcf7973ddfde8a5..915345525ed3c2721ec0831a35d59f883ed0eee4 100644 |
--- a/runtime/bin/vmservice/resources.dart |
+++ b/runtime/bin/vmservice/resources.dart |
@@ -40,9 +40,21 @@ class Resource { |
static final Map<String, Resource> resources = new Map<String, Resource>(); |
} |
+ZLibCodec _zlib; |
-void _addResource(String name, List<int> data) { |
+void _addResource(String name, List<int> data, bool compressed) { |
var mimeType = detectMimeType(name); |
+ if (compressed) { |
+ if (_zlib == null) { |
+ _zlib = new ZLibCodec(); |
+ } |
+ try { |
+ data = _zlib.decode(data); |
+ } catch(e) { |
+ print('error decompressing service isolate resource: $name'); |
+ return; |
+ } |
+ } |
Resource resource = new Resource(name, mimeType, data); |
Resource.resources[name] = resource; |
} |