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

Side by Side Diff: runtime/observatory/lib/service_common.dart

Issue 892913003: Rename the get* methods in preparation for removing them. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: one more test Created 5 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 | « runtime/observatory/bin/shell.dart ('k') | runtime/observatory/lib/src/app/page.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library service_common; 5 library service_common;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:typed_data'; 9 import 'dart:typed_data';
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 Future get onDisconnect => _disconnected.future; 121 Future get onDisconnect => _disconnected.future;
122 122
123 void disconnect() { 123 void disconnect() {
124 if (_hasInitiatedConnect) { 124 if (_hasInitiatedConnect) {
125 _webSocket.close(); 125 _webSocket.close();
126 } 126 }
127 _cancelAllRequests(); 127 _cancelAllRequests();
128 _notifyDisconnect(); 128 _notifyDisconnect();
129 } 129 }
130 130
131 Future<String> getString(String id) { 131 Future<String> getStringDeprecated(String id) {
132 if (!_hasInitiatedConnect) { 132 if (!_hasInitiatedConnect) {
133 _hasInitiatedConnect = true; 133 _hasInitiatedConnect = true;
134 _webSocket.connect( 134 _webSocket.connect(
135 target.networkAddress, _onOpen, _onMessage, _onError, _onClose); 135 target.networkAddress, _onOpen, _onMessage, _onError, _onClose);
136 } 136 }
137 return _makeRequest(id); 137 return _makeRequest(id);
138 } 138 }
139 139
140 /// Add a request for [id] to pending requests. 140 /// Add a request for [id] to pending requests.
141 Future<String> _makeRequest(String id) { 141 Future<String> _makeRequest(String id) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 }); 308 });
309 } else { 309 } else {
310 message = JSON.encode({'id': serial, 310 message = JSON.encode({'id': serial,
311 'method': request.method, 311 'method': request.method,
312 'params': request.params}); 312 'params': request.params});
313 } 313 }
314 // Send message. 314 // Send message.
315 _webSocket.send(message); 315 _webSocket.send(message);
316 } 316 }
317 } 317 }
OLDNEW
« no previous file with comments | « runtime/observatory/bin/shell.dart ('k') | runtime/observatory/lib/src/app/page.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698