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

Unified Diff: runtime/observatory/lib/src/repositories/target.dart

Issue 2991183002: Fix Observatory double connection in clean browser (Closed)
Patch Set: Fix variable name Created 3 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/repositories/target.dart
diff --git a/runtime/observatory/lib/src/repositories/target.dart b/runtime/observatory/lib/src/repositories/target.dart
index f5a11187d144470a7ad26ae2ceb8bbe2b7ace839..0756956e6badedf7eeeee7cdd67d39a61845b057 100644
--- a/runtime/observatory/lib/src/repositories/target.dart
+++ b/runtime/observatory/lib/src/repositories/target.dart
@@ -31,12 +31,15 @@ class TargetRepository implements M.TargetRepository {
TargetRepository._(this._isConnectedVMTarget, this._onChange, this.onChange) {
_restore();
+ final defaultAddress = _networkAddressOfDefaultTarget();
+ var defaultTarget = find(defaultAddress);
// Add the default address if it doesn't already exist.
- if (find(_networkAddressOfDefaultTarget()) == null) {
- add(_networkAddressOfDefaultTarget());
+ if (defaultTarget == null) {
+ defaultTarget = new SC.WebSocketVMTarget(defaultAddress);
+ _list.insert(0, defaultTarget);
}
// Set the current target to the default target.
- current = find(_networkAddressOfDefaultTarget());
+ current = defaultTarget;
}
void add(String address) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698