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

Unified Diff: runtime/bin/vmservice/client/lib/src/elements/service_ref.dart

Issue 192443004: Complete the switch to ServiceObject (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/client/lib/src/elements/service_ref.dart
diff --git a/runtime/bin/vmservice/client/lib/src/elements/service_ref.dart b/runtime/bin/vmservice/client/lib/src/elements/service_ref.dart
index 00c41759d254b778599a99b5cfaf0a0b732e39e2..9af8c163b566a4836fd2c7f887c74b606191a200 100644
--- a/runtime/bin/vmservice/client/lib/src/elements/service_ref.dart
+++ b/runtime/bin/vmservice/client/lib/src/elements/service_ref.dart
@@ -5,11 +5,12 @@
library service_ref_element;
import 'package:polymer/polymer.dart';
-import 'isolate_element.dart';
+import 'observatory_element.dart';
+import 'package:observatory/service.dart';
@CustomTag('service-ref')
-class ServiceRefElement extends IsolateElement {
- @published Map ref;
+class ServiceRefElement extends ObservatoryElement {
+ @published ServiceObject ref;
@published bool internal = false;
ServiceRefElement.created() : super.created();
@@ -20,35 +21,30 @@ class ServiceRefElement extends IsolateElement {
}
String get url {
- if ((isolate == null) || (ref == null)) {
- return '';
+ if (ref == null) {
+ return 'NULL REF';
turnidge 2014/03/10 21:03:28 Do these nulls happen a lot? Do they happen at al
Cutch 2014/03/11 03:17:48 Let's discuss this tomorrow.
}
- return isolate.hashLink(objectId);
+ return ref.hashLink;
}
- String get objectId => ref == null ? '' : ref['id'];
+ String get serviceId {
+ if (ref == null) {
+ return 'NULL REF';
+ }
+ return ref.id;
+ }
String get hoverText {
if (ref == null) {
- return '';
+ return 'NULL REF';
}
- // Return the VM name by default.
- var name = ref['name'];
- return name != null ? name : '';
+ return ref.vmName;
}
String get name {
if (ref == null) {
return 'NULL REF';
}
- String name_key = internal ? 'name' : 'user_name';
- if (ref[name_key] != null) {
- return ref[name_key];
- } else if (ref['name'] != null) {
- return ref['name'];
- } else if (ref['user_name'] != null) {
- return ref['user_name'];
- }
- return '';
+ return ref.name;
}
}

Powered by Google App Engine
This is Rietveld 408576698