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

Side by Side Diff: lib/html/src/dart2js_DOMImplementation.dart

Issue 11074005: Wrap Window in case it's a window from a different page / frame. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comment Created 8 years, 2 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 // TODO(vsm): Unify with Dartium version. 5 // TODO(vsm): Unify with Dartium version.
6 class _DOMWindowCrossFrameImpl implements Window { 6 class _DOMWindowCrossFrameImpl implements Window {
7 // Private window. Note, this is a window in another frame, so it 7 // Private window. Note, this is a window in another frame, so it
8 // cannot be typed as "Window" as its prototype is not patched 8 // cannot be typed as "Window" as its prototype is not patched
9 // properly. Its fields and methods can only be accessed via JavaScript. 9 // properly. Its fields and methods can only be accessed via JavaScript.
10 var _window; 10 var _window;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 class _LocationCrossFrameImpl implements Location { 58 class _LocationCrossFrameImpl implements Location {
59 // Private location. Note, this is a location object in another frame, so it 59 // Private location. Note, this is a location object in another frame, so it
60 // cannot be typed as "Location" as its prototype is not patched 60 // cannot be typed as "Location" as its prototype is not patched
61 // properly. Its fields and methods can only be accessed via JavaScript. 61 // properly. Its fields and methods can only be accessed via JavaScript.
62 var _location; 62 var _location;
63 63
64 void set href(String val) => _setHref(_location, val); 64 void set href(String val) => _setHref(_location, val);
65 static void _setHref(location, val) { 65 static void _setHref(location, val) {
66 JS('void', '#.href = #', _location, val); 66 JS('void', '#.href = #', location, val);
67 } 67 }
68 68
69 // Implementation support. 69 // Implementation support.
70 _LocationCrossFrameImpl(this._location); 70 _LocationCrossFrameImpl(this._location);
71 71
72 static Location _createSafe(location) { 72 static Location _createSafe(location) {
73 if (location === window.location) { 73 if (location === window.location) {
74 return location; 74 return location;
75 } else { 75 } else {
76 // TODO(vsm): Cache or implement equality. 76 // TODO(vsm): Cache or implement equality.
(...skipping 19 matching lines...) Expand all
96 96
97 static History _createSafe(h) { 97 static History _createSafe(h) {
98 if (h === window.history) { 98 if (h === window.history) {
99 return h; 99 return h;
100 } else { 100 } else {
101 // TODO(vsm): Cache or implement equality. 101 // TODO(vsm): Cache or implement equality.
102 return new _HistoryCrossFrameImpl(h); 102 return new _HistoryCrossFrameImpl(h);
103 } 103 }
104 } 104 }
105 } 105 }
OLDNEW
« no previous file with comments | « lib/html/src/dart2js_Conversions.dart ('k') | lib/html/templates/html/dart2js/impl_IFrameElement.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698