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

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

Issue 9724017: Editor debugger fixes to support Windows. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/BrowserManager.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/ResourceServer.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/ResourceServer.java (revision 5604)
+++ editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/ResourceServer.java (working copy)
@@ -14,6 +14,7 @@
package com.google.dart.tools.debug.core.util;
+import com.google.dart.tools.core.DartCore;
import com.google.dart.tools.debug.core.DartDebugCorePlugin;
import org.eclipse.core.resources.IFile;
@@ -66,17 +67,19 @@
@Override
public String getUrlForResource(IFile file) {
try {
- String path;
+ URI fileUri = file.getLocation().toFile().toURI();
-// if (file.isLinked()) {
- path = file.getRawLocation().toOSString();
-// } else {
-// path = file.getFullPath().toPortableString();
-// }
+ String pathSegment = fileUri.getPath();
- URI uri = new URI("http", null, serverSocket.getInetAddress().getHostAddress(),
- serverSocket.getLocalPort(), path, null, null);
- return uri.toString();
+ if (DartCore.isWindows()) {
+ URI uri = new URI("http", null, "localhost", serverSocket.getLocalPort(), pathSegment,
+ null, null);
+ return uri.toString();
+ } else {
+ URI uri = new URI("http", null, serverSocket.getInetAddress().getHostAddress(),
+ serverSocket.getLocalPort(), pathSegment, null, null);
+ return uri.toString();
+ }
} catch (URISyntaxException e) {
DartDebugCorePlugin.logError(e);
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/util/BrowserManager.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698