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

Unified Diff: runtime/bin/vmservice/resources.dart

Issue 1151743002: Decrease Dart binary size by 1.7MB (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/bin/bin.gypi ('k') | runtime/bin/vmservice_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « runtime/bin/bin.gypi ('k') | runtime/bin/vmservice_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698