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

Unified Diff: runtime/bin/vmservice/client/lib/src/app/location_manager.dart

Issue 205713004: Add isolate tag-profile and better handling of errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/client/lib/src/app/location_manager.dart
diff --git a/runtime/bin/vmservice/client/lib/src/app/location_manager.dart b/runtime/bin/vmservice/client/lib/src/app/location_manager.dart
index d35ca5d7be47e06bbfd795e87201e4bda7645d3e..3071571227edb2cbd2b83461d0df91f75f00a803 100644
--- a/runtime/bin/vmservice/client/lib/src/app/location_manager.dart
+++ b/runtime/bin/vmservice/client/lib/src/app/location_manager.dart
@@ -15,36 +15,24 @@ class LocationManager extends Observable {
void init() {
window.onHashChange.listen((event) {
- if (setDefaultHash()) {
- // We just triggered another onHashChange event.
- return;
- }
// Request the current anchor.
requestCurrentHash();
});
-
- if (!setDefaultHash()) {
- // An anchor was already present, trigger a request.
- requestCurrentHash();
- }
+ // Set the default hash.
+ window.location.hash = defaultHash;
}
- /// If no anchor is set, set the default anchor and return true.
- /// Return false otherwise.
- bool setDefaultHash() {
- currentHash = window.location.hash;
- if (currentHash == '' || currentHash == '#') {
- window.location.hash = defaultHash;
- return true;
- }
- return false;
+ /// Clear the current hash.
+ void clearCurrentHash() {
+ window.location.hash = '';
}
/// Refresh the service object reference in the location entry.
void requestCurrentHash() {
currentHash = window.location.hash;
- assert(currentHash.startsWith('#/'));
-
+ if (!currentHash.startsWith('#/')) {
+ return;
+ }
var parts = currentHash.substring(2).split('#');
var location = parts[0];
var args = (parts.length > 1 ? parts[1] : '');
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/app/chart.dart ('k') | runtime/bin/vmservice/client/lib/src/elements/isolate_view.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698