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

Unified Diff: plugins/org.chromium.debug.core/src/org/chromium/debug/core/SourceNameMapperContainer.java

Issue 9704071: Issue 61: Provide an extension point to have custom local file -> script mapping (Closed) Base URL: https://chromedevtools.googlecode.com/svn/trunk
Patch Set: format 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 | « plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseSourceLookup.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plugins/org.chromium.debug.core/src/org/chromium/debug/core/SourceNameMapperContainer.java
diff --git a/plugins/org.chromium.debug.core/src/org/chromium/debug/core/SourceNameMapperContainer.java b/plugins/org.chromium.debug.core/src/org/chromium/debug/core/SourceNameMapperContainer.java
index 5f38b2f844676945d28ce9478f88d2448d908bd7..8ee91723cb948fa09b95b59f48a97613b04c017e 100644
--- a/plugins/org.chromium.debug.core/src/org/chromium/debug/core/SourceNameMapperContainer.java
+++ b/plugins/org.chromium.debug.core/src/org/chromium/debug/core/SourceNameMapperContainer.java
@@ -1,5 +1,7 @@
package org.chromium.debug.core;
+import org.chromium.debug.core.ReverseSourceLookup.ContainerWrapper;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -18,7 +20,7 @@ import org.eclipse.osgi.util.NLS;
* Currently container supports only prefix-based translation: if source name starts with a prefix,
* the prefix is truncated; otherwise the source name is discarded.
*/
-public class SourceNameMapperContainer implements ISourceContainer {
+public class SourceNameMapperContainer implements ReverseLookupContainer {
private static final String TYPE_ID =
"org.chromium.debug.core.SourceNameMapperContainer.type"; //$NON-NLS-1$
@@ -74,6 +76,25 @@ public class SourceNameMapperContainer implements ISourceContainer {
return true;
}
+ @Override
+ public ContainerWrapper getReveseLookupImpl() {
+ final ContainerWrapper targetContainerWrapper =
+ ReverseSourceLookup.wrapSourceContainer(getTargetContainer());
+ if (targetContainerWrapper == null) {
+ return null;
+ }
+ return new ContainerWrapper() {
+ @Override
+ public String lookup(IFile resource) {
+ String subResult = targetContainerWrapper.lookup(resource);
+ if (subResult == null) {
+ return null;
+ }
+ return prefix + subResult;
+ }
+ };
+ }
+
private String getMemento() throws CoreException {
StringBuilder builder = new StringBuilder();
MementoFormat.encodeComponent(prefix, builder);
« no previous file with comments | « plugins/org.chromium.debug.core/src/org/chromium/debug/core/ReverseSourceLookup.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698