Chromium Code Reviews| Index: runtime/bin/vmservice/client/lib/src/observatory_elements/script_ref.dart |
| diff --git a/runtime/bin/vmservice/client/lib/src/observatory_elements/script_ref.dart b/runtime/bin/vmservice/client/lib/src/observatory_elements/script_ref.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2f1661e27a8d441fab76eba46cd6a03bee32db3e |
| --- /dev/null |
| +++ b/runtime/bin/vmservice/client/lib/src/observatory_elements/script_ref.dart |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library script_ref_element; |
| + |
| +import 'package:polymer/polymer.dart'; |
| +import 'observatory_element.dart'; |
| + |
| +@CustomTag('script-ref') |
| +class ScriptRefElement extends ObservatoryElement { |
| + @published Map ref; |
| + @published String scriptURL = ''; |
| + ScriptRefElement.created() : super.created(); |
| + |
| + void refChanged(oldValue) { |
| + notifyPropertyChange(#url, "", url); |
| + notifyPropertyChange(#name, [], name); |
| + } |
| + |
| + void scriptURLChanged(oldValue) { |
| + notifyPropertyChange(#url, "", url); |
| + notifyPropertyChange(#name, [], name); |
| + } |
| + |
| + String get url { |
| + print('$app $ref'); |
|
turnidge
2013/12/19 20:39:29
Do you mean to have this print here?
Cutch
2013/12/19 21:53:58
Removed.
|
| + if (app != null && ref != null) { |
| + return app.locationManager.currentIsolateRelativeLink(ref['id']); |
| + } else if (app != null) { |
| + return app.locationManager.currentIsolateScriptLink(scriptURL); |
| + } |
|
turnidge
2013/12/19 20:39:29
So sometimes we build a script-ref from a 'ref' an
Cutch
2013/12/19 21:53:58
Yes, it's just because 'frame' outputs a 'url' pro
|
| + return ''; |
| + } |
| + |
| + String get name { |
| + return ref != null ? ref['name'] : scriptURL; |
| + } |
| +} |