OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 part of app; | 5 part of app; |
6 | 6 |
7 class IsolateNotFound implements Exception { | 7 class IsolateNotFound implements Exception { |
8 String isolateId; | 8 String isolateId; |
9 IsolateNotFound(this.isolateId); | 9 IsolateNotFound(this.isolateId); |
10 String toString() => "IsolateNotFound: $isolateId"; | 10 String toString() => "IsolateNotFound: $isolateId"; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 class DebuggerPage extends SimplePage { | 185 class DebuggerPage extends SimplePage { |
186 DebuggerPage(app) : super('debugger', 'debugger-page', app); | 186 DebuggerPage(app) : super('debugger', 'debugger-page', app); |
187 | 187 |
188 void _visit(Uri uri) { | 188 void _visit(Uri uri) { |
189 super._visit(uri); | 189 super._visit(uri); |
190 getIsolate(uri).then((isolate) { | 190 getIsolate(uri).then((isolate) { |
191 if (element != null) { | 191 if (element != null) { |
192 /// Update the page. | 192 /// Update the page. |
193 DebuggerPageElement page = element; | 193 DebuggerPageElement page = element; |
194 page.app = app; | |
195 page.isolate = isolate; | 194 page.isolate = isolate; |
196 } | 195 } |
197 }); | 196 }); |
198 } | 197 } |
199 } | 198 } |
200 | 199 |
201 class CpuProfilerPage extends SimplePage { | 200 class CpuProfilerPage extends SimplePage { |
202 CpuProfilerPage(app) : super('profiler', 'cpu-profile', app); | 201 CpuProfilerPage(app) : super('profiler', 'cpu-profile', app); |
203 | 202 |
204 void _visit(Uri uri) { | 203 void _visit(Uri uri) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 void _visit(Uri uri) { | 372 void _visit(Uri uri) { |
374 assert(element != null); | 373 assert(element != null); |
375 assert(canVisit(uri)); | 374 assert(canVisit(uri)); |
376 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { | 375 app.vm.getIsolate(uri.queryParameters['isolateId']).then((i) { |
377 (element as MetricsPageElement).isolate = i; | 376 (element as MetricsPageElement).isolate = i; |
378 }); | 377 }); |
379 } | 378 } |
380 | 379 |
381 bool canVisit(Uri uri) => uri.path == 'metrics'; | 380 bool canVisit(Uri uri) => uri.path == 'metrics'; |
382 } | 381 } |
OLD | NEW |