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

Side by Side Diff: lib/isolate/frog/natives.js

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 10 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 | « lib/isolate/frog/messages.dart ('k') | lib/isolate/frog/ports.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Top-level native code needed by the frog compiler
6
7 var $globalThis = this;
8 var $globals = null;
9 var $globalState = null;
10
11 // Wrap a 0-arg dom-callback to bind it with the current isolate:
12 function $wrap_call$0(fn) { return fn && fn.wrap$call$0(); }
13
14 Function.prototype.wrap$call$0 = function() {
15 var isolateContext = $globalState.currentContext;
16 var self = this;
17 this.wrap$0 = function() {
18 isolateContext.eval(self);
19 $globalState.topEventLoop.run();
20 };
21 this.wrap$call$0 = function() { return this.wrap$0; };
22 return this.wrap$0;
23 };
24
25 // Wrap a 1-arg dom-callback to bind it with the current isolate:
26 function $wrap_call$1(fn) { return fn && fn.wrap$call$1(); }
27
28 Function.prototype.wrap$call$1 = function() {
29 var isolateContext = $globalState.currentContext;
30 var self = this;
31 this.wrap$1 = function(arg) {
32 isolateContext.eval(function() { self(arg); });
33 $globalState.topEventLoop.run();
34 };
35 this.wrap$call$1 = function() { return this.wrap$1; };
36 return this.wrap$1;
37 };
OLDNEW
« no previous file with comments | « lib/isolate/frog/messages.dart ('k') | lib/isolate/frog/ports.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698