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

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

Issue 993613002: Implement 'print', 'up', 'down', and 'frame' commands in the Observatory debugger. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 5 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/vmservice/server.dart ('k') | runtime/observatory/lib/src/cli/command.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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // from the vm. 196 // from the vm.
197 postServiceEvent(response, null); 197 postServiceEvent(response, null);
198 return; 198 return;
199 } 199 }
200 // Complete request. 200 // Complete request.
201 var request = _pendingRequests.remove(serial); 201 var request = _pendingRequests.remove(serial);
202 if (request == null) { 202 if (request == null) {
203 Logger.root.severe('Received unexpected message: ${map}'); 203 Logger.root.severe('Received unexpected message: ${map}');
204 return; 204 return;
205 } 205 }
206 if (request.method != 'getTagProfile' &&
207 request.method != 'getIsolateMetric' &&
208 request.method != 'getVMMetric') {
209 Logger.root.info(
210 'RESPONSE [${serial}] ${request.method}');
211 }
206 request.completer.complete(response); 212 request.completer.complete(response);
207 } 213 }
208 214
209 // WebSocket message event handler. 215 // WebSocket message event handler.
210 void _onMessage(dynamic data) { 216 void _onMessage(dynamic data) {
211 if (data is! String) { 217 if (data is! String) {
212 _onBinaryMessage(data); 218 _onBinaryMessage(data);
213 } else { 219 } else {
214 _onStringMessage(data); 220 _onStringMessage(data);
215 } 221 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 Logger.root.info('Sending all delayed requests.'); 259 Logger.root.info('Sending all delayed requests.');
254 // Send all delayed requests. 260 // Send all delayed requests.
255 _delayedRequests.forEach(_sendRequest); 261 _delayedRequests.forEach(_sendRequest);
256 // Clear all delayed requests. 262 // Clear all delayed requests.
257 _delayedRequests.clear(); 263 _delayedRequests.clear();
258 } 264 }
259 265
260 /// Send the request over WebSocket. 266 /// Send the request over WebSocket.
261 void _sendRequest(String serial, _WebSocketRequest request) { 267 void _sendRequest(String serial, _WebSocketRequest request) {
262 assert (_webSocket.isOpen); 268 assert (_webSocket.isOpen);
263 if (request.method != 'getTagProfile' &&
264 request.method != 'getIsolateMetric' &&
265 request.method != 'getVMMetric') {
266 Logger.root.info('GET ${request.method} from ${target.networkAddress}');
267 }
268 // Mark request as pending. 269 // Mark request as pending.
269 assert(_pendingRequests.containsKey(serial) == false); 270 assert(_pendingRequests.containsKey(serial) == false);
270 _pendingRequests[serial] = request; 271 _pendingRequests[serial] = request;
271 var message; 272 var message;
272 // Encode message. 273 // Encode message.
273 if (target.chrome) { 274 if (target.chrome) {
274 message = JSON.encode({ 275 message = JSON.encode({
275 'id': int.parse(serial), 276 'id': int.parse(serial),
276 'method': 'Dart.observatoryQuery', 277 'method': 'Dart.observatoryQuery',
277 'params': { 278 'params': {
278 'id': serial, 279 'id': serial,
279 'query': request.method 280 'query': request.method
280 } 281 }
281 }); 282 });
282 } else { 283 } else {
283 message = JSON.encode({'id': serial, 284 message = JSON.encode({'id': serial,
284 'method': request.method, 285 'method': request.method,
285 'params': request.params}); 286 'params': request.params});
286 } 287 }
288 if (request.method != 'getTagProfile' &&
289 request.method != 'getIsolateMetric' &&
290 request.method != 'getVMMetric') {
291 Logger.root.info(
292 'GET [${serial}] ${request.method} from ${target.networkAddress}');
293 }
287 // Send message. 294 // Send message.
288 _webSocket.send(message); 295 _webSocket.send(message);
289 } 296 }
290 } 297 }
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/server.dart ('k') | runtime/observatory/lib/src/cli/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698