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

Unified Diff: lib/dom/templates/html/dartium/html_dartium.darttemplate

Issue 10456006: Wrapperless dart:html for Dartium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: lib/dom/templates/html/dartium/html_dartium.darttemplate
diff --git a/lib/dom/templates/html/dartium/html_dartium.darttemplate b/lib/dom/templates/html/dartium/html_dartium.darttemplate
index 30b44010869e1111330533000e550859878601cd..64467149388c74d15236796dfd5efae396820134 100644
--- a/lib/dom/templates/html/dartium/html_dartium.darttemplate
+++ b/lib/dom/templates/html/dartium/html_dartium.darttemplate
@@ -31,59 +31,13 @@ $!GENERATED_DART_FILES
#source('$AUXILIARY_DIR/native_DOMPublic.dart');
#source('$AUXILIARY_DIR/native_DOMImplementation.dart');
-_WindowImpl __window;
-_DocumentImpl __document;
+Window get window() => _Utils.window();
+Window get _window() => _Utils.window();
-void _initialize() {
- __window = _wrap(_Utils.window());
- __document = _wrap(_Utils.window().document);
-}
+Document get document() => window.document;
+Document get _document() => window.document;
-Window get window() {
- if (__window == null) {
- _initialize();
- }
- return __window;
-}
+// FIXME: get rid of _uwrap and _wrap.
+_unwrap(raw) => raw;
-Document get document() {
- if (__document == null) {
- _initialize();
- }
- return __document;
-}
-
-_WindowImpl get _window() {
- if (__window == null) {
- _initialize();
- }
- return __window;
-}
-
-_DocumentImpl get _document() {
- if (__document == null) {
- _initialize();
- }
- return __document;
-}
-
-_unwrap(raw) {
- return raw is _DOMTypeBase ? raw._ptr : raw;
-}
-
-// Warning: does not attempt wrap event listeners.
-_wrap(raw) {
- if (raw is! _DOMWrapperBase) return raw;
- _DOMWrapperBase domObject = raw;
- if (domObject.dartObjectLocalStorage != null)
- return domObject.dartObjectLocalStorage;
- switch(domObject.typeName) {
- case 'HTMLElement':
- return new _UnknownElementImpl._wrap(domObject);
-$WRAPCASES
- case 'HTMLDocument':
- return new _DocumentImpl._wrap(domObject);
- default:
- throw 'Unrecognized object $domObject. Name=${domObject.typeName}';
- }
-}
+_wrap(raw) => raw;

Powered by Google App Engine
This is Rietveld 408576698