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

Side by Side Diff: runtime/lib/isolate_patch.dart

Issue 2564383002: Make some VM libraries patch cleanly using the analyzer. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | sdk/lib/internal/symbol.dart » ('J')
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 import "dart:collection" show HashMap; 5 import "dart:collection" show HashMap;
6 import "dart:_internal"; 6 import "dart:_internal";
7 7
8 @patch class ReceivePort { 8 @patch class ReceivePort {
9 @patch factory ReceivePort() = _ReceivePortImpl; 9 @patch factory ReceivePort() = _ReceivePortImpl;
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 close() { 71 close() {
72 _rawPort.close(); 72 _rawPort.close();
73 _controller.close(); 73 _controller.close();
74 } 74 }
75 75
76 final RawReceivePort _rawPort; 76 final RawReceivePort _rawPort;
77 StreamController _controller; 77 StreamController _controller;
78 } 78 }
79 79
80 typedef void ImmediateCallback(); 80 typedef void _ImmediateCallback();
81 81
82 /// The callback that has been registered through `scheduleImmediate`. 82 /// The callback that has been registered through `scheduleImmediate`.
83 ImmediateCallback _pendingImmediateCallback; 83 _ImmediateCallback _pendingImmediateCallback;
84 84
85 /// The closure that should be used as scheduleImmediateClosure, when the VM 85 /// The closure that should be used as scheduleImmediateClosure, when the VM
86 /// is responsible for the event loop. 86 /// is responsible for the event loop.
87 void _isolateScheduleImmediate(void callback()) { 87 void _isolateScheduleImmediate(void callback()) {
88 assert(_pendingImmediateCallback == null); 88 assert(_pendingImmediateCallback == null);
89 _pendingImmediateCallback = callback; 89 _pendingImmediateCallback = callback;
90 } 90 }
91 91
92 void _runPendingImmediateCallback() { 92 void _runPendingImmediateCallback() {
93 if (_pendingImmediateCallback != null) { 93 if (_pendingImmediateCallback != null) {
94 var callback = _pendingImmediateCallback; 94 var callback = _pendingImmediateCallback;
95 _pendingImmediateCallback = null; 95 _pendingImmediateCallback = null;
96 callback(); 96 callback();
97 } 97 }
98 } 98 }
99 99
100 ImmediateCallback _removePendingImmediateCallback() { 100 _ImmediateCallback _removePendingImmediateCallback() {
101 var callback = _pendingImmediateCallback; 101 var callback = _pendingImmediateCallback;
102 _pendingImmediateCallback = null; 102 _pendingImmediateCallback = null;
103 return callback; 103 return callback;
104 } 104 }
105 105
106 /// The embedder can execute this function to get hold of 106 /// The embedder can execute this function to get hold of
107 /// [_isolateScheduleImmediate] above. 107 /// [_isolateScheduleImmediate] above.
108 Function _getIsolateScheduleImmediateClosure() { 108 Function _getIsolateScheduleImmediateClosure() {
109 return _isolateScheduleImmediate; 109 return _isolateScheduleImmediate;
110 } 110 }
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 try { 578 try {
579 return Uri.parse(_getCurrentRootUriStr()); 579 return Uri.parse(_getCurrentRootUriStr());
580 } catch (e, s) { 580 } catch (e, s) {
581 return null; 581 return null;
582 } 582 }
583 } 583 }
584 584
585 static String _getCurrentRootUriStr() 585 static String _getCurrentRootUriStr()
586 native "Isolate_getCurrentRootUriStr"; 586 native "Isolate_getCurrentRootUriStr";
587 } 587 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | sdk/lib/internal/symbol.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698