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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/elements/function_view.dart

Issue 379223002: Observatory: Fix left over from class not being a ServiceObject (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 function_view_element; 5 library function_view_element;
6 6
7 import 'observatory_element.dart'; 7 import 'observatory_element.dart';
8 import 'package:observatory/service.dart'; 8 import 'package:observatory/service.dart';
9 9
10 import 'package:polymer/polymer.dart'; 10 import 'package:polymer/polymer.dart';
11 11
12 @CustomTag('function-view') 12 @CustomTag('function-view')
13 class FunctionViewElement extends ObservatoryElement { 13 class FunctionViewElement extends ObservatoryElement {
14 @published ServiceMap function; 14 @published ServiceMap function;
15 FunctionViewElement.created() : super.created(); 15 FunctionViewElement.created() : super.created();
16 16
17 // TODO(turnidge): Once we create a Function object, these fields 17 // TODO(turnidge): Once we create a Function object, these fields
18 // should move there. 18 // should move there.
19 @published String qualifiedName; 19 @published String qualifiedName;
20 @published String kind; 20 @published String kind;
21 21
22 String _getQualifiedName(ServiceMap function) { 22 String _getQualifiedName(ServiceMap function) {
23 var parent = (function != null && function['parent'] != null 23 var parent = (function != null && function['parent'] != null
24 ? function['parent'] : null); 24 ? function['parent'] : null);
25 if (parent != null) { 25 if (parent != null) {
26 return "${_getQualifiedName(parent)}.${function['user_name']}"; 26 return "${_getQualifiedName(parent)}.${function['user_name']}";
27 } 27 }
28 var cls = (function != null && 28 Class cls = (function != null &&
29 function['owner'] != null && 29 function['owner'] != null &&
30 function['owner'].serviceType == 'Class' 30 function['owner'].serviceType == 'Class'
31 ? function['owner'] : null); 31 ? function['owner'] : null);
32 if (cls != null) { 32 if (cls != null) {
33 return "${cls['user_name']}.${function['user_name']}"; 33 return "${cls.name}.${function['user_name']}";
34 } 34 }
35 return "${function['user_name']}"; 35 return "${function['user_name']}";
36 } 36 }
37 37
38 void functionChanged(oldValue) { 38 void functionChanged(oldValue) {
39 notifyPropertyChange(#qualifiedName, 0, 1); 39 notifyPropertyChange(#qualifiedName, 0, 1);
40 notifyPropertyChange(#kind, 0, 1); 40 notifyPropertyChange(#kind, 0, 1);
41 qualifiedName = _getQualifiedName(function); 41 qualifiedName = _getQualifiedName(function);
42 switch(function['kind']) { 42 switch(function['kind']) {
43 case 'kRegularFunction': 43 case 'kRegularFunction':
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 default: 79 default:
80 kind = 'UNKNOWN'; 80 kind = 'UNKNOWN';
81 break; 81 break;
82 } 82 }
83 } 83 }
84 84
85 void refresh(var done) { 85 void refresh(var done) {
86 function.reload().whenComplete(done); 86 function.reload().whenComplete(done);
87 } 87 }
88 } 88 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698