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

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

Issue 10694134: Reuse _dispatchEvent for sync message sending. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:isolate"); 10 #import("dart:isolate");
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool _callPortInitialized = false; 75 bool _callPortInitialized = false;
76 var _callPortLastResult = null; 76 var _callPortLastResult = null;
77 77
78 _callPortSync(num id, var message) { 78 _callPortSync(num id, var message) {
79 if (!_callPortInitialized) { 79 if (!_callPortInitialized) {
80 window.on['js-result'].add((event) { 80 window.on['js-result'].add((event) {
81 _callPortLastResult = JSON.parse(event.data); 81 _callPortLastResult = JSON.parse(event.data);
82 }, false); 82 }, false);
83 _callPortInitialized = true; 83 _callPortInitialized = true;
84 } 84 }
85 var data = JSON.stringify({ 'id': id, 'message': message });
86 var event = document.$dom_createEvent('TextEvent');
87 event.initTextEvent('js-sync-message', false, false, window, data);
88 assert(_callPortLastResult == null); 85 assert(_callPortLastResult == null);
89 window.$dom_dispatchEvent(event); 86 _dispatchEvent('js-sync-message', {'id': id, 'message': message});
90 var result = _callPortLastResult; 87 var result = _callPortLastResult;
91 _callPortLastResult = null; 88 _callPortLastResult = null;
92 return result; 89 return result;
93 } 90 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698