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

Unified Diff: runtime/observatory/lib/src/app/application.dart

Issue 1013563002: CPU profile displayed in three tables with a tree (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | runtime/observatory/lib/src/app/location_manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/app/application.dart
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index d87d6fb6339416b0ed32c2fe8d92ee40876a3f16..a76823276e0f34b0996428b57188e5bbb7b56bc4 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -9,8 +9,9 @@ part of app;
class ObservatoryApplication extends Observable {
static ObservatoryApplication app;
final _pageRegistry = new List<Page>();
+ LocationManager _locationManager;
+ LocationManager get locationManager => _locationManager;
@observable Page currentPage;
- @observable final LocationManager locationManager;
VM _vm;
VM get vm => _vm;
set vm(VM vm) {
@@ -42,12 +43,13 @@ class ObservatoryApplication extends Observable {
@observable ObservableList<ServiceEvent> notifications =
new ObservableList<ServiceEvent>();
- void _initOnce(bool chromium) {
+ void _initOnce() {
assert(app == null);
app = this;
_registerPages();
Analytics.initialize();
- locationManager._init(this);
+ // Visit the current page.
+ locationManager._visit();
}
void removePauseEvents(Isolate isolate) {
@@ -105,6 +107,7 @@ class ObservatoryApplication extends Observable {
_pageRegistry.add(new ClassTreePage(this));
_pageRegistry.add(new DebuggerPage(this));
_pageRegistry.add(new CpuProfilerPage(this));
+ _pageRegistry.add(new TableCpuProfilerPage(this));
_pageRegistry.add(new AllocationProfilerPage(this));
_pageRegistry.add(new HeapMapPage(this));
_pageRegistry.add(new VMConnectPage(this));
@@ -117,7 +120,7 @@ class ObservatoryApplication extends Observable {
void _onError(ServiceError error) {
lastErrorOrException = error;
- _visit('error/', null);
+ _visit(Uri.parse('error/'), null);
}
void _onException(ServiceException exception) {
@@ -127,19 +130,13 @@ class ObservatoryApplication extends Observable {
this.vm = null;
locationManager.go(locationManager.makeLink('/vm-connect/'));
} else {
- _visit('error/', null);
+ _visit(Uri.parse('error/'), null);
}
}
- void _visit(String url, String args) {
- var argsMap;
- if (args == null) {
- argsMap = {};
- } else {
- argsMap = Uri.splitQueryString(args);
- }
- if (argsMap['trace'] != null) {
- var traceArg = argsMap['trace'];
+ void _visit(Uri uri, Map internalArguments) {
+ if (internalArguments['trace'] != null) {
+ var traceArg = internalArguments['trace'];
if (traceArg == 'on') {
Tracer.start();
} else if (traceArg == 'off') {
@@ -152,12 +149,11 @@ class ObservatoryApplication extends Observable {
if (_traceView != null) {
_traceView.tracer = Tracer.current;
}
- Uri uri = Uri.parse(url);
for (var i = 0; i < _pageRegistry.length; i++) {
var page = _pageRegistry[i];
if (page.canVisit(uri)) {
_installPage(page);
- page.visit(uri, argsMap);
+ page.visit(uri, internalArguments);
return;
}
}
@@ -196,10 +192,10 @@ class ObservatoryApplication extends Observable {
}
ObservatoryApplication(this.rootElement) :
- locationManager = new HashLocationManager(),
targets = new TargetManager() {
+ _locationManager = new LocationManager(this);
vm = new WebSocketVM(targets.defaultTarget);
- _initOnce(false);
+ _initOnce();
}
void _removeDisconnectEvents() {
« no previous file with comments | « no previous file | runtime/observatory/lib/src/app/location_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698