Index: runtime/observatory/lib/src/elements/isolate_reconnect.dart |
diff --git a/runtime/observatory/lib/src/elements/isolate_reconnect.dart b/runtime/observatory/lib/src/elements/isolate_reconnect.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3de1078c41b135a2c291be1950e70c7e3472c40b |
--- /dev/null |
+++ b/runtime/observatory/lib/src/elements/isolate_reconnect.dart |
@@ -0,0 +1,30 @@ |
+// Copyright (c) 2014, 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 isolate_reconnect_element; |
+ |
+import 'dart:html'; |
+import 'package:polymer/polymer.dart'; |
+import 'observatory_element.dart'; |
+import 'package:observatory/app.dart'; |
+import 'package:observatory/service_html.dart'; |
+ |
+@CustomTag('isolate-reconnect') |
+class IsolateReconnectElement extends ObservatoryElement { |
+ IsolateReconnectElement.created() : super.created(); |
+ |
+ get missingIsolateId { |
+ return app.locationManager.uri.queryParameters['originalIsolateId']; |
+ } |
+ |
+ linkToContinueIn(isolate) { |
+ var parameters = new Map.from(app.locationManager.uri.queryParameters); |
+ parameters['isolateId'] = isolate.id; |
+ parameters.remove('originalIsolateId'); |
+ var path = parameters.remove('originalPath'); |
+ path = "/$path"; |
+ var generatedUri = new Uri(path: path, queryParameters: parameters); |
+ return app.locationManager.makeLink(generatedUri.toString()); |
+ } |
+} |