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

Side by Side Diff: tools/dom/templates/html/impl/impl_Blob.darttemplate

Issue 1832713002: Optimize dartium dart:html bindings so real world application performance is acceptable. Improves d… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update cached patches Created 4 years, 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { 7 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
8 $!MEMBERS 8 $!MEMBERS
9 $if DART2JS 9 $if DART2JS
10 factory Blob(List blobParts, [String type, String endings]) { 10 factory Blob(List blobParts, [String type, String endings]) {
(...skipping 13 matching lines...) Expand all
24 static _create_2(parts, bag) => JS('Blob', 'new Blob(#, #)', parts, bag); 24 static _create_2(parts, bag) => JS('Blob', 'new Blob(#, #)', parts, bag);
25 25
26 static _create_bag() => JS('var', '{}'); 26 static _create_bag() => JS('var', '{}');
27 static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); } 27 static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); }
28 $else 28 $else
29 $if JSINTEROP 29 $if JSINTEROP
30 factory Blob(List blobParts, [String type, String endings]) { 30 factory Blob(List blobParts, [String type, String endings]) {
31 // TODO: any coercions on the elements of blobParts, e.g. coerce a typed 31 // TODO: any coercions on the elements of blobParts, e.g. coerce a typed
32 // array to ArrayBuffer if it is a total view. 32 // array to ArrayBuffer if it is a total view.
33 33
34 var parts = convertDartToNative_List(blobParts.map(unwrap_jso).toList()); 34 var parts = convertDartToNative_List(blobParts);
35 if (type == null && endings == null) { 35 if (type == null && endings == null) {
36 return wrap_jso(_blink.BlinkBlob.instance.constructorCallback_1_(parts)); 36 return _blink.BlinkBlob.instance.constructorCallback_1_(parts);
37 } 37 }
38 var bag = {}; 38 var bag = {};
39 if (type != null) bag['type'] = type; 39 if (type != null) bag['type'] = type;
40 if (endings != null) bag['endings'] = endings; 40 if (endings != null) bag['endings'] = endings;
41 return wrap_jso(_blink.BlinkBlob.instance.constructorCallback_2_(parts, 41 return _blink.BlinkBlob.instance.constructorCallback_2_(parts,
42 convertDartToNative_Dictionary(bag))); 42 convertDartToNative_Dictionary(bag));
43 } 43 }
44 $endif 44 $endif
45 $endif 45 $endif
46 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698