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

Side by Side Diff: runtime/bin/io_service_patch.dart

Issue 2759973004: Fix observatory tests broken by running dartfmt. Temporarily reverted formatting for evaluate_activ… (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « runtime/bin/filter_patch.dart ('k') | runtime/bin/platform_patch.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 @patch class _IOService { 5 @patch
6 class _IOService {
6 // Lazy initialize service ports, 32 per isolate. 7 // Lazy initialize service ports, 32 per isolate.
7 static const int _SERVICE_PORT_COUNT = 32; 8 static const int _SERVICE_PORT_COUNT = 32;
8 static List<SendPort> _servicePort = new List(_SERVICE_PORT_COUNT); 9 static List<SendPort> _servicePort = new List(_SERVICE_PORT_COUNT);
9 static RawReceivePort _receivePort; 10 static RawReceivePort _receivePort;
10 static SendPort _replyToPort; 11 static SendPort _replyToPort;
11 static Map<int, Completer> _messageMap = {}; 12 static Map<int, Completer> _messageMap = {};
12 static int _id = 0; 13 static int _id = 0;
13 14
14 @patch static Future _dispatch(int request, List data) { 15 @patch
16 static Future _dispatch(int request, List data) {
15 int id; 17 int id;
16 do { 18 do {
17 id = _getNextId(); 19 id = _getNextId();
18 } while (_messageMap.containsKey(id)); 20 } while (_messageMap.containsKey(id));
19 int index = id % _SERVICE_PORT_COUNT; 21 int index = id % _SERVICE_PORT_COUNT;
20 _initialize(index); 22 _initialize(index);
21 var completer = new Completer(); 23 var completer = new Completer();
22 _messageMap[id] = completer; 24 _messageMap[id] = completer;
23 try { 25 try {
24 _servicePort[index].send([id, _replyToPort, request, data]); 26 _servicePort[index].send([id, _replyToPort, request, data]);
(...skipping 29 matching lines...) Expand all
54 _receivePort = null; 56 _receivePort = null;
55 } 57 }
56 58
57 static int _getNextId() { 59 static int _getNextId() {
58 if (_id == 0x7FFFFFFF) _id = 0; 60 if (_id == 0x7FFFFFFF) _id = 0;
59 return _id++; 61 return _id++;
60 } 62 }
61 63
62 static SendPort _newServicePort() native "IOService_NewServicePort"; 64 static SendPort _newServicePort() native "IOService_NewServicePort";
63 } 65 }
OLDNEW
« no previous file with comments | « runtime/bin/filter_patch.dart ('k') | runtime/bin/platform_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698