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

Side by Side Diff: tools/dom/src/dart2js_DOMImplementation.dart

Issue 2983813002: Add hook to register global object (Closed)
Patch Set: Rebase Created 3 years, 5 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 html; 5 part of html;
6 6
7 // TODO(vsm): Unify with Dartium version. 7 // TODO(vsm): Unify with Dartium version.
8 class _DOMWindowCrossFrame implements WindowBase { 8 class _DOMWindowCrossFrame implements WindowBase {
9 // Private window. Note, this is a window in another frame, so it 9 // Private window. Note, this is a window in another frame, so it
10 // cannot be typed as "Window" as its prototype is not patched 10 // cannot be typed as "Window" as its prototype is not patched
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 // Implementation support. 49 // Implementation support.
50 _DOMWindowCrossFrame(this._window); 50 _DOMWindowCrossFrame(this._window);
51 51
52 static WindowBase _createSafe(w) { 52 static WindowBase _createSafe(w) {
53 if (identical(w, window)) { 53 if (identical(w, window)) {
54 return w; 54 return w;
55 } else { 55 } else {
56 // TODO(vsm): Cache or implement equality. 56 // TODO(vsm): Cache or implement equality.
57 registerGlobalObject(w);
57 return new _DOMWindowCrossFrame(w); 58 return new _DOMWindowCrossFrame(w);
58 } 59 }
59 } 60 }
60 61
61 // TODO(efortuna): Remove this method. dartbug.com/16814 62 // TODO(efortuna): Remove this method. dartbug.com/16814
62 Events get on => throw new UnsupportedError( 63 Events get on => throw new UnsupportedError(
63 'You can only attach EventListeners to your own window.'); 64 'You can only attach EventListeners to your own window.');
64 // TODO(efortuna): Remove this method. dartbug.com/16814 65 // TODO(efortuna): Remove this method. dartbug.com/16814
65 void _addEventListener(String type, EventListener listener, 66 void _addEventListener(String type, EventListener listener,
66 [bool useCapture]) => 67 [bool useCapture]) =>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 128
128 static HistoryBase _createSafe(h) { 129 static HistoryBase _createSafe(h) {
129 if (identical(h, window.history)) { 130 if (identical(h, window.history)) {
130 return h; 131 return h;
131 } else { 132 } else {
132 // TODO(vsm): Cache or implement equality. 133 // TODO(vsm): Cache or implement equality.
133 return new _HistoryCrossFrame(h); 134 return new _HistoryCrossFrame(h);
134 } 135 }
135 } 136 }
136 } 137 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698