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

Unified Diff: runtime/bin/vmservice/observatory/lib/src/app/page.dart

Issue 584293002: Begin implementing a debugger page in Observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: use flexbox, basic commandline Created 6 years, 3 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/bin/vmservice/observatory/lib/src/app/page.dart
diff --git a/runtime/bin/vmservice/observatory/lib/src/app/page.dart b/runtime/bin/vmservice/observatory/lib/src/app/page.dart
index 12ba46c5b552d6f653f29db85fd5b078924b581a..518946c56fd011a6ad8d75f1a888d95bbb6e1720 100644
--- a/runtime/bin/vmservice/observatory/lib/src/app/page.dart
+++ b/runtime/bin/vmservice/observatory/lib/src/app/page.dart
@@ -90,11 +90,11 @@ class ClassTreePage extends Page {
// isolate url.
url = url.substring(_urlPrefix.length);
/// Request the isolate url.
- app.vm.get(url).then((i) {
+ app.vm.get(url).then((isolate) {
if (element != null) {
/// Update the page.
ClassTreeElement page = element;
- page.isolate = i;
+ page.isolate = isolate;
}
}).catchError((e) {
Logger.root.severe('ClassTreePage visit error: $e');
@@ -105,6 +105,39 @@ class ClassTreePage extends Page {
bool canVisit(String url) => url.startsWith(_urlPrefix);
}
+class DebuggerPage extends Page {
+ static const _urlPrefix = 'debugger/';
+
+ DebuggerPage(app) : super(app);
+
+ void onInstall() {
+ if (element == null) {
+ element = new Element.tag('debugger-page');
+ }
+ }
+
+ void _visit(String url) {
+ assert(element != null);
+ assert(canVisit(url));
+ // Debugger urls are 'debugger/isolate-id', chop off prefix, leaving
+ // isolate url.
+ url = url.substring(_urlPrefix.length);
+ /// Request the isolate url.
+ app.vm.get(url).then((isolate) {
+ if (element != null) {
+ /// Update the page.
+ DebuggerPageElement page = element;
+ page.isolate = isolate;
+ }
+ }).catchError((e) {
+ Logger.root.severe('Unexpected debugger error: $e');
+ });
+ }
+
+ /// Catch all.
+ bool canVisit(String url) => url.startsWith(_urlPrefix);
+}
+
class ErrorViewPage extends Page {
ErrorViewPage(app) : super(app);

Powered by Google App Engine
This is Rietveld 408576698