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

Unified Diff: runtime/bin/vmservice/client/lib/src/observatory_elements/script_ref.dart

Issue 98253009: Refactor VM service IDs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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/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..1f991c6034d9f00554587fdcf921a8f5db37ff63
--- /dev/null
+++ b/runtime/bin/vmservice/client/lib/src/observatory_elements/script_ref.dart
@@ -0,0 +1,40 @@
+// 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;
+ // TODO(johnmccutchan): Remove scriptURL once Frame objects provide a proper
+ // script reference.
+ @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 {
+ if (app != null && ref != null) {
+ return app.locationManager.currentIsolateRelativeLink(ref['id']);
+ } else if (app != null) {
+ return app.locationManager.currentIsolateScriptLink(scriptURL);
+ }
+ return '';
+ }
+
+ String get name {
+ return ref != null ? ref['name'] : scriptURL;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698