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

Unified Diff: editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/BrowserManager.java

Issue 10690002: Fix some issues when debugging against package: libraries (Dartium and command-line). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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: editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/BrowserManager.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/BrowserManager.java (revision 9145)
+++ editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/BrowserManager.java (working copy)
@@ -531,18 +531,23 @@
env.put("DART_FLAGS", "--enable-checked-mode");
}
- //pass in pref value for --package-root if set
+ // Pass in --package-root if the preference is set
String packageRoot = DartCore.getPlugin().getPackageRootPref();
- // TODO (keertip): if using default "packages" directory, do not set env variable
+ // TODO(keertip): if using default "packages" directory, do not set env variable
+ // TODO(devoncarew): why are we only passing package root in when launching a file (not a url)?
if (packageRoot != null && launchConfig.getShouldLaunchFile()) {
- String packageRootUri;
try {
- packageRootUri = getResourceServer().getUrlForFile(new Path(packageRoot).toFile());
+ String packageRootUri = getResourceServer().getUrlForFile(new Path(packageRoot).toFile());
+
+ // Strip a trailing slash off the uri if the user setting didn't have one.
+ if (!packageRoot.endsWith("/") && packageRootUri.endsWith("/")) {
+ packageRootUri = packageRootUri.substring(0, packageRootUri.length() - 1);
+ }
+
env.put("DART_PACKAGE_ROOT", packageRootUri);
} catch (IOException e) {
DartDebugCorePlugin.logError(e);
}
-
}
devToolsPortNumber = DEVTOOLS_PORT_NUMBER;
@@ -596,7 +601,6 @@
}
browserProcess = null;
}
-
}
private void waitForProcessToTerminate(Process process, int maxWaitTimeMs) {

Powered by Google App Engine
This is Rietveld 408576698