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

Unified Diff: runtime/observatory/lib/src/elements/service_ref.dart

Issue 2204973003: Converted Observatory class-ref & library-ref elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixed indentation Created 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/elements/service_ref.dart
diff --git a/runtime/observatory/lib/src/elements/service_ref.dart b/runtime/observatory/lib/src/elements/service_ref.dart
index d368713f5f0adb7655f410fd9cc6150e9ec6d5f7..e0a28fea5c46ef060c479f9f0047c456c55ab944 100644
--- a/runtime/observatory/lib/src/elements/service_ref.dart
+++ b/runtime/observatory/lib/src/elements/service_ref.dart
@@ -7,11 +7,18 @@ library service_ref_element;
import 'dart:html';
import 'package:logging/logging.dart';
+import 'package:observatory/models.dart' as M;
import 'package:observatory/service.dart';
import 'package:polymer/polymer.dart';
import 'class_ref.dart';
+import 'class_ref_as_value.dart';
+import 'code_ref.dart';
+import 'error_ref.dart';
+import 'function_ref.dart';
import 'library_ref.dart';
+import 'library_ref_as_value.dart';
+import 'script_ref.dart';
import 'observatory_element.dart';
class ServiceRefElement extends ObservatoryElement {
@@ -91,43 +98,49 @@ class AnyServiceRefElement extends ObservatoryElement {
var type = ref.type;
switch (type) {
case 'Class':
- ClassRefElement element = new Element.tag('class-ref');
- element.ref = ref;
- element.asValue = asValue;
- return element;
+ if (asValue) {
+ ClassRefAsValueElement element =
+ new Element.tag('class-ref-as-element');
+ element.ref = ref;
+ return element;
+ }
+ return new ClassRefElement(ref.isolate,
+ ref as M.ClassRef,
+ queue: app.queue);
case 'Code':
- ServiceRefElement element = new Element.tag('code-ref');
- element.ref = ref;
- return element;
+ return new CodeRefElement(ref.isolate, ref as M.Code, queue: app.queue);
case 'Context':
ServiceRefElement element = new Element.tag('context-ref');
element.ref = ref;
return element;
case 'Error':
- ServiceRefElement element = new Element.tag('error-ref');
- element.ref = ref;
- return element;
+ return new ErrorRefElement(ref as M.ErrorRef, queue: app.queue);
case 'Field':
ServiceRefElement element = new Element.tag('field-ref');
element.ref = ref;
return element;
case 'Function':
- ServiceRefElement element = new Element.tag('function-ref');
- element.ref = ref;
- return element;
+ return new FunctionRefElement(ref.isolate,
+ ref as M.FunctionRef,
+ queue: app.queue);
case 'Library':
- LibraryRefElement element = new Element.tag('library-ref');
- element.ref = ref;
- element.asValue = asValue;
- return element;
+ if (asValue) {
+ LibraryRefAsValueElement element =
+ new Element.tag('library-ref-as-value');
+ element.ref = ref;
+ return element;
+ }
+ return new LibraryRefElement(ref.isolate,
+ ref as M.LibraryRef,
+ queue: app.queue);
case 'Object':
ServiceRefElement element = new Element.tag('object-ref');
element.ref = ref;
return element;
case 'Script':
- ServiceRefElement element = new Element.tag('script-ref');
- element.ref = ref;
- return element;
+ return new ScriptRefElement(ref.isolate,
+ ref as M.ScriptRef,
+ queue: app.queue);
case 'Instance':
case 'Sentinel':
ServiceRefElement element = new Element.tag('instance-ref');
« no previous file with comments | « runtime/observatory/lib/src/elements/objectstore_view.html ('k') | runtime/observatory/lib/src/elements/vm_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698