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

Unified Diff: lib/dom/templates/crossframe_impl.darttemplate

Issue 10378040: Generate and use cross frame wrappers for types in other frames/windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Factored out template 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/crossframe_impl.darttemplate
diff --git a/lib/dom/templates/crossframe_impl.darttemplate b/lib/dom/templates/crossframe_impl.darttemplate
new file mode 100644
index 0000000000000000000000000000000000000000..22219ec120db82b8c9fd00985d94819527c2c04f
--- /dev/null
+++ b/lib/dom/templates/crossframe_impl.darttemplate
@@ -0,0 +1,22 @@
+
+class _$(NAME)CrossFrameImpl implements $(NAME) {
+$!MEMBERS
+ // Implementation.
+ $(CLASSNAME) $POINTER;
+
+ _$(NAME)CrossFrameImpl._(this.$POINTER);
+
+ static _createSafe(ptr) {
+ if (ptr === $LOCAL) {
+ return $LOCAL;
+ } else {
+ // TODO(vsm): Should we cache to try to get reference equality?
+ return new _$(NAME)CrossFrameImpl._(ptr);
+ }
+ }
+
+ operator ==(other) {
+ return (other is _$(NAME)CrossFrameImpl) &&
+ (this.$POINTER === other.$POINTER);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698