| OLD | NEW |
| 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 // Some value smaller than the object ring, so requesting a large array | 7 // Some value smaller than the object ring, so requesting a large array |
| 8 // doesn't result in an expired ref because the elements lapped it in the | 8 // doesn't result in an expired ref because the elements lapped it in the |
| 9 // object ring. | 9 // object ring. |
| 10 const int kDefaultFieldLimit = 100; | 10 const int kDefaultFieldLimit = 100; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 break; | 210 break; |
| 211 case 'Counter': | 211 case 'Counter': |
| 212 obj = new ServiceMetric._empty(owner); | 212 obj = new ServiceMetric._empty(owner); |
| 213 break; | 213 break; |
| 214 case 'Error': | 214 case 'Error': |
| 215 obj = new DartError._empty(owner); | 215 obj = new DartError._empty(owner); |
| 216 break; | 216 break; |
| 217 case 'Field': | 217 case 'Field': |
| 218 obj = new Field._empty(owner); | 218 obj = new Field._empty(owner); |
| 219 break; | 219 break; |
| 220 case 'AsyncFrame': |
| 220 case 'Frame': | 221 case 'Frame': |
| 221 obj = new Frame._empty(owner); | 222 obj = new Frame._empty(owner); |
| 222 break; | 223 break; |
| 223 case 'Function': | 224 case 'Function': |
| 224 obj = new ServiceFunction._empty(owner); | 225 obj = new ServiceFunction._empty(owner); |
| 225 break; | 226 break; |
| 226 case 'Gauge': | 227 case 'Gauge': |
| 227 obj = new ServiceMetric._empty(owner); | 228 obj = new ServiceMetric._empty(owner); |
| 228 break; | 229 break; |
| 229 case 'Isolate': | 230 case 'Isolate': |
| (...skipping 4153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4383 vmName = map['name']; | 4384 vmName = map['name']; |
| 4384 value = map['value']; | 4385 value = map['value']; |
| 4385 min = map['min']; | 4386 min = map['min']; |
| 4386 max = map['max']; | 4387 max = map['max']; |
| 4387 } | 4388 } |
| 4388 | 4389 |
| 4389 String toString() => "ServiceMetric($_id)"; | 4390 String toString() => "ServiceMetric($_id)"; |
| 4390 } | 4391 } |
| 4391 | 4392 |
| 4392 class Frame extends ServiceObject implements M.Frame { | 4393 class Frame extends ServiceObject implements M.Frame { |
| 4394 M.FrameKind kind = M.FrameKind.regular; |
| 4393 int index; | 4395 int index; |
| 4394 ServiceFunction function; | 4396 ServiceFunction function; |
| 4395 SourceLocation location; | 4397 SourceLocation location; |
| 4396 Code code; | 4398 Code code; |
| 4397 List<ServiceMap> variables = <ServiceMap>[]; | 4399 List<ServiceMap> variables = <ServiceMap>[]; |
| 4400 String marker; |
| 4398 | 4401 |
| 4399 Frame._empty(ServiceObject owner) : super._empty(owner); | 4402 Frame._empty(ServiceObject owner) : super._empty(owner); |
| 4400 | 4403 |
| 4401 void _update(Map map, bool mapIsRef) { | 4404 void _update(Map map, bool mapIsRef) { |
| 4402 assert(!mapIsRef); | 4405 assert(!mapIsRef); |
| 4403 _loaded = true; | 4406 _loaded = true; |
| 4404 _upgradeCollection(map, owner); | 4407 _upgradeCollection(map, owner); |
| 4408 this.kind = _fromString(map['kind']); |
| 4409 this.marker = map['marker']; |
| 4405 this.index = map['index']; | 4410 this.index = map['index']; |
| 4406 this.function = map['function']; | 4411 this.function = map['function']; |
| 4407 this.location = map['location']; | 4412 this.location = map['location']; |
| 4408 this.code = map['code']; | 4413 this.code = map['code']; |
| 4409 this.variables = map['vars']; | 4414 this.variables = map['vars'] ?? []; |
| 4410 } | 4415 } |
| 4411 | 4416 |
| 4412 String toString() => "Frame(${function.qualifiedName} $location)"; | 4417 M.FrameKind _fromString(String frameKind) { |
| 4418 if (frameKind == null) { |
| 4419 return M.FrameKind.regular; |
| 4420 } |
| 4421 switch (frameKind) { |
| 4422 case 'kMarker': return M.FrameKind.marker; |
| 4423 case 'kRegular': return M.FrameKind.regular; |
| 4424 case 'kAsyncLive': return M.FrameKind.asyncLive; |
| 4425 case 'kAsyncHistorical': return M.FrameKind.asyncHistorical; |
| 4426 default: |
| 4427 throw new UnsupportedError('Unknown FrameKind: $frameKind'); |
| 4428 } |
| 4429 |
| 4430 } |
| 4431 String toString() => "Frame([$kind] ${function.qualifiedName} $location)"; |
| 4413 } | 4432 } |
| 4414 | 4433 |
| 4415 class ServiceMessage extends ServiceObject { | 4434 class ServiceMessage extends ServiceObject { |
| 4416 int index; | 4435 int index; |
| 4417 String messageObjectId; | 4436 String messageObjectId; |
| 4418 int size; | 4437 int size; |
| 4419 ServiceFunction handler; | 4438 ServiceFunction handler; |
| 4420 SourceLocation location; | 4439 SourceLocation location; |
| 4421 | 4440 |
| 4422 ServiceMessage._empty(ServiceObject owner) : super._empty(owner); | 4441 ServiceMessage._empty(ServiceObject owner) : super._empty(owner); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4514 var v = list[i]; | 4533 var v = list[i]; |
| 4515 if ((v is Map) && _isServiceMap(v)) { | 4534 if ((v is Map) && _isServiceMap(v)) { |
| 4516 list[i] = owner.getFromMap(v); | 4535 list[i] = owner.getFromMap(v); |
| 4517 } else if (v is List) { | 4536 } else if (v is List) { |
| 4518 _upgradeList(v, owner); | 4537 _upgradeList(v, owner); |
| 4519 } else if (v is Map) { | 4538 } else if (v is Map) { |
| 4520 _upgradeMap(v, owner); | 4539 _upgradeMap(v, owner); |
| 4521 } | 4540 } |
| 4522 } | 4541 } |
| 4523 } | 4542 } |
| OLD | NEW |