| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |