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

Side by Side Diff: lib/dom/templates/html/dartium/html_dartium.darttemplate

Issue 9732019: dart:html perf optimization based on runing Dromaeo benchmarks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 8 years, 9 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) 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 // DO NOT EDIT 5 // DO NOT EDIT
6 // Auto-generated dart:html library. 6 // Auto-generated dart:html library.
7 7
8 #library("html"); 8 #library("html");
9 9
10 #import('dart:dom', prefix:'dom'); 10 #import('dart:dom', prefix:'dom');
(...skipping 14 matching lines...) Expand all
25 #source('../../html/src/_Testing.dart'); 25 #source('../../html/src/_Testing.dart');
26 #source('../../html/src/_DOMTypeBase.dart'); 26 #source('../../html/src/_DOMTypeBase.dart');
27 #source('../../dom/src/_ListIterators.dart'); 27 #source('../../dom/src/_ListIterators.dart');
28 #source('../../dom/src/_Lists.dart'); 28 #source('../../dom/src/_Lists.dart');
29 29
30 _WindowImpl __window; 30 _WindowImpl __window;
31 _DocumentImpl __document; 31 _DocumentImpl __document;
32 32
33 void _initialize() { 33 void _initialize() {
34 __window = _wrap(dom.window); 34 __window = _wrap(dom.window);
35 __document = _wrap(dom.document.documentElement); 35 __document = _wrap(dom.document);
36 } 36 }
37 37
38 Window get window() { 38 Window get window() {
39 if (__window == null) { 39 if (__window == null) {
40 _initialize(); 40 _initialize();
41 } 41 }
42 return __window; 42 return __window;
43 } 43 }
44 44
45 Document get document() { 45 Document get document() {
(...skipping 21 matching lines...) Expand all
67 return raw is _DOMTypeBase ? raw._ptr : raw; 67 return raw is _DOMTypeBase ? raw._ptr : raw;
68 } 68 }
69 69
70 // Warning: does not attempt wrap event listeners. 70 // Warning: does not attempt wrap event listeners.
71 _wrap(raw) { 71 _wrap(raw) {
72 if (raw is! dom.DOMType) return raw; 72 if (raw is! dom.DOMType) return raw;
73 dom.DOMType domObject = raw; 73 dom.DOMType domObject = raw;
74 if (domObject.dartObjectLocalStorage != null) 74 if (domObject.dartObjectLocalStorage != null)
75 return domObject.dartObjectLocalStorage; 75 return domObject.dartObjectLocalStorage;
76 switch(domObject.typeName) { 76 switch(domObject.typeName) {
77 case 'HTMLDocument':
78 throw 'A document should never be wrapped directly. TODO(jacobr) XXX';
79 case 'HTMLHtmlElement':
80 return new _DocumentImpl._wrap(domObject);
81 case 'HTMLElement': 77 case 'HTMLElement':
82 return new _UnknownElementImpl._wrap(domObject); 78 return new _UnknownElementImpl._wrap(domObject);
83 $WRAPCASES 79 $WRAPCASES
80 case 'HTMLDocument':
81 return new _DocumentImpl._wrap(domObject);
84 default: 82 default:
85 throw 'Unrecognized object $domObject. Name=${domObject.typeName}'; 83 throw 'Unrecognized object $domObject. Name=${domObject.typeName}';
86 } 84 }
87 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698