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

Side by Side Diff: runtime/bin/vmservice/resources.dart

Issue 533073005: Reduce service isolate startup time from ~80ms to ~30ms (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of vmservice_io; 5 part of vmservice_io;
6 6
7 String detectMimeType(String name) { 7 String detectMimeType(String name) {
8 var extensionStart = name.lastIndexOf('.'); 8 var extensionStart = name.lastIndexOf('.');
9 var extension = name.substring(extensionStart+1); 9 var extension = name.substring(extensionStart+1);
10 switch (extension) { 10 switch (extension) {
(...skipping 26 matching lines...) Expand all
37 Resource(this.name, this.mimeType, this.data); 37 Resource(this.name, this.mimeType, this.data);
38 static final Map<String, Resource> resources = new Map<String, Resource>(); 38 static final Map<String, Resource> resources = new Map<String, Resource>();
39 } 39 }
40 40
41 41
42 void _addResource(String name, List<int> data) { 42 void _addResource(String name, List<int> data) {
43 var mimeType = detectMimeType(name); 43 var mimeType = detectMimeType(name);
44 Resource resource = new Resource(name, mimeType, data); 44 Resource resource = new Resource(name, mimeType, data);
45 Resource.resources[name] = resource; 45 Resource.resources[name] = resource;
46 } 46 }
47
48 void _triggerResourceLoad() native "VMServiceIO_TriggerResourceLoad";
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698