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

Side by Side Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/server/ServerRemoteScriptSourceContainer.java

Issue 322303002: Version 1.5.0-dev.4.6 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ServerDebugTarget target = ServerDebugTarget.getActiveTarget(); 56 ServerDebugTarget target = ServerDebugTarget.getActiveTarget();
57 57
58 if (target != null) { 58 if (target != null) {
59 // builtin:id:url 59 // builtin:id:url
60 name = name.substring("builtin:".length()); 60 name = name.substring("builtin:".length());
61 int index = name.indexOf(':'); 61 int index = name.indexOf(':');
62 String url = name.substring(index + 1); 62 String url = name.substring(index + 1);
63 int libraryId = Integer.parseInt(name.substring(0, index)); 63 int libraryId = Integer.parseInt(name.substring(0, index));
64 64
65 // TODO(devoncarew): change the buildin: format to an opaque token into a map; this will 65 // TODO(devoncarew): change the buildin: format to an opaque token into a map; this will
66 // let us eliminate the call to target.getMainIsolate(). 66 // let us eliminate the call to target.getCurrentIsolate().
67 String source = target.getConnection().getScriptSource( 67 String source = target.getConnection().getScriptSource(
68 target.getMainIsolate(), 68 target.getCurrentIsolate(),
69 libraryId, 69 libraryId,
70 url); 70 url);
71 71
72 if (source != null) { 72 if (source != null) {
73 try { 73 try {
74 return new Object[] {getCreateStorageFor(url, source)}; 74 return new Object[] {getCreateStorageFor(url, source)};
75 } catch (IOException e) { 75 } catch (IOException e) {
76 throw new CoreException(new Status( 76 throw new CoreException(new Status(
77 IStatus.ERROR, 77 IStatus.ERROR,
78 DartDebugCorePlugin.PLUGIN_ID, 78 DartDebugCorePlugin.PLUGIN_ID,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 return cachedSourceMap.get(url); 121 return cachedSourceMap.get(url);
122 } 122 }
123 123
124 private String sanitizeFileName(String str) { 124 private String sanitizeFileName(String str) {
125 return str.replace(':', '~').replace('/', '_').replace('\\', '_'); 125 return str.replace(':', '~').replace('/', '_').replace('\\', '_');
126 } 126 }
127 127
128 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698