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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/service/object.dart

Issue 429293002: Add request tracing to Observatory: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
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 part of service; 5 part of service;
6 6
7 /// A [ServiceObject] is an object known to the VM service and is tied 7 /// A [ServiceObject] is an object known to the VM service and is tied
8 /// to an owning [Isolate]. 8 /// to an owning [Isolate].
9 abstract class ServiceObject extends Observable { 9 abstract class ServiceObject extends Observable {
10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) { 10 static int LexicalSortName(ServiceObject o1, ServiceObject o2) {
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 }))); 409 })));
410 } 410 }
411 411
412 /// Gets [id] as an [ObservableMap] from the service directly. If 412 /// Gets [id] as an [ObservableMap] from the service directly. If
413 /// an error occurs, the future is completed as an error with a 413 /// an error occurs, the future is completed as an error with a
414 /// ServiceError or ServiceException. Therefore any chained then() calls 414 /// ServiceError or ServiceException. Therefore any chained then() calls
415 /// will only receive a map encoding a valid ServiceObject. 415 /// will only receive a map encoding a valid ServiceObject.
416 Future<ObservableMap> getAsMap(String id) { 416 Future<ObservableMap> getAsMap(String id) {
417 return getString(id).then((response) { 417 return getString(id).then((response) {
418 var map = _parseJSON(response); 418 var map = _parseJSON(response);
419 if (Tracer.current != null) {
420 Tracer.current.trace("Received response for ${id}", map:map);
421 }
419 return _processMap(map); 422 return _processMap(map);
420 }).catchError((error) { 423 }).catchError((error) {
421 // ServiceError, forward to VM's ServiceError stream. 424 // ServiceError, forward to VM's ServiceError stream.
422 errors.add(error); 425 errors.add(error);
423 return new Future.error(error); 426 return new Future.error(error);
424 }, test: (e) => e is ServiceError).catchError((exception) { 427 }, test: (e) => e is ServiceError).catchError((exception) {
425 // ServiceException, forward to VM's ServiceException stream. 428 // ServiceException, forward to VM's ServiceException stream.
426 exceptions.add(exception); 429 exceptions.add(exception);
427 return new Future.error(exception); 430 return new Future.error(exception);
428 }, test: (e) => e is ServiceException); 431 }, test: (e) => e is ServiceException);
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 var v = list[i]; 2236 var v = list[i];
2234 if ((v is ObservableMap) && _isServiceMap(v)) { 2237 if ((v is ObservableMap) && _isServiceMap(v)) {
2235 list[i] = owner.getFromMap(v); 2238 list[i] = owner.getFromMap(v);
2236 } else if (v is ObservableList) { 2239 } else if (v is ObservableList) {
2237 _upgradeObservableList(v, owner); 2240 _upgradeObservableList(v, owner);
2238 } else if (v is ObservableMap) { 2241 } else if (v is ObservableMap) {
2239 _upgradeObservableMap(v, owner); 2242 _upgradeObservableMap(v, owner);
2240 } 2243 }
2241 } 2244 }
2242 } 2245 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698