Examples of VmResourceId


Examples of org.chromium.debug.core.model.VmResourceId

    super(debugProject);
    this.debugProject = debugProject;
  }

  public synchronized void addScript(Script newScript) {
    VmResourceId id = VmResourceId.forScript(newScript);
    try {
      VmResourceInfo info = resourceIdToInfo.get(id);
      ScriptSet scriptSet;
      if (info == null) {
        scriptSet = new ScriptSet();
        info = createAndRegisterResourceFile(id, scriptSet);
      } else {
        // TODO(peter.rybin): support adding scripts to one resource at
        // once not to rewrite file
        // every time.
        scriptSet = (ScriptSet) info.getMetadata();
        ;
      }
      scriptSet.add(newScript);
      writeScriptSource(scriptSet.asCollection(), info.getFile());
      addCromiumBreakpointFromJs(id.getName(), info.getFile());
    } catch (RuntimeException e) {
      throw new RuntimeException("Failed to add script " + id, e);
    }
  }
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

      }
    }
  };

  public VmResource getVProjectVmResource(IFile file) {
    VmResourceId resourceId = resourceManager.getResourceId(file);
    if (resourceId == null) {
      return null;
    }
    return resourceManager.getVmResource(resourceId);
  }
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

     * Checks whether adding the resource section to map is possible.
     * @return {@link RangeAdder} object that can be used to perform "add" operation; not null
     * @throws CannotAddException if resource section overlaps with already registered section
     */
    private RangeAdder checkCanAddRange(ResourceSection section) throws CannotAddException {
      final VmResourceId resourceId = section.getResourceId();
      final ResourceData data = resourceIdToData.get(resourceId);
      final Range range = Range.create(section);

      if (data != null) {
        data.checkCanAddRange(range);
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

   * whether the resource has actually been loaded into the VM (you may want to set a breakpoint
   * on resource before it is actually loaded).
   */
  public VmResourceId findVmResource(IFile sourceFile) throws CoreException {
    for (ISourceContainer container : sourceDirector.getSourceContainers()) {
      VmResourceId scriptName = tryForContainer(sourceFile, container);
      if (scriptName != null) {
        return scriptName;
      }
    }
    return null;
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

  private VmResourceId tryForContainer(IFile sourceFile, ISourceContainer container)
      throws CoreException {
    if (container.isComposite() && isSupportedCompositeContainer(container)) {
      ISourceContainer[] subContainers = container.getSourceContainers();
      for (ISourceContainer subContainer : subContainers) {
        VmResourceId res = tryForContainer(sourceFile, subContainer);
        if (res != null) {
          return res;
        }
      }
      return null;
    } else if (container instanceof VProjectSourceContainer) {
      VProjectSourceContainer projectSourceContainer = (VProjectSourceContainer) container;
      return projectSourceContainer.findScriptId(sourceFile);
    } else {
      String name = tryForNonVirtualContainer(sourceFile, container);
      if (name == null) {
        return null;
      }
      return new VmResourceId(name, null);
    }
  }
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

          return nameManipulator.getFileName(scriptName);
        }
      };

  private static String getSourceNameImpl(Object object) throws CoreException {
    VmResourceId vmResourceId = getVmResourceId(object);
    if (vmResourceId == null) {
      return null;
    }
    String name = vmResourceId.getName();
    if (name == null) {
      // Do not return null, this will cancel look-up.
      // Return empty string. Virtual project container will pass us some data.
      name = ""; //$NON-NLS-1$
    }
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

      return jsStackFrame.getVmResourceId();
    } else if (object instanceof Breakpoint) {
      Breakpoint breakpoint = (Breakpoint) object;
      return breakpoint.getTarget().accept(BREAKPOINT_RESOURCE_VISITOR);
    } else if (object instanceof VmResourceId) {
      VmResourceId resourceId = (VmResourceId) object;
      return resourceId;
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

   * {@link ResourceManager} object that can be processed here, where we have full
   * {@link VmResourceId}.
   */
  private static void expandVProjectResult(VProjectSourceContainer.LookupResult lookupResult,
      Object object, ArrayList<Object> output) throws CoreException {
    VmResourceId resourceId = getVmResourceId(object);
    if (resourceId.getId() != null) {
      VmResource vmResource = lookupResult.getVmResource(resourceId);
      if (vmResource != null) {
        output.add(vmResource.getVProjectFile());
      }
    }
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

   * Creates a sample position map and checks several points.
   */
  @Test
  public void basicTest() throws CannotAddException {
    SourcePositionMapBuilder builder = new PositionMapBuilderImpl();
    builder.addMapping(new ResourceSection(new VmResourceId("source1.js", null), 0, 0, 5, 0),
        new ResourceSection(new VmResourceId("compiled.js", null), 0, 0, 1, 0),
        new TextSectionMappingImpl(
            new StringMappingData(new int [] { 0,0, 1,02,03,04,0 } , 5, 0),
            new StringMappingData(new int [] { 0,0, 0,10, 0,20, 0,30, 0,40 }, 0, 50)));

    builder.addMapping(new ResourceSection(new VmResourceId("source2.js", null), 0, 0, 5, 0),
        new ResourceSection(new VmResourceId("compiled.js", null), 1, 0, 2, 0),
        new TextSectionMappingImpl(
            new StringMappingData(new int [] { 0,0, 1,02,03,04,0}, 5, 0),
            new StringMappingData(new int [] { 1,0, 1,10, 1,20, 1,30, 1,40}, 1, 50)));

    builder.addMapping(new ResourceSection(new VmResourceId("source3.js", null), 0, 0, 5, 0),
        new ResourceSection(new VmResourceId("compiled.js", null), 2, 0, 3, 0),
        new TextSectionMappingImpl(
            new StringMappingData(new int [] {0,0, 1,02,03,04,0}, 5, 0),
            new StringMappingData(new int [] {2,0, 2,10, 2,20, 2,30, 2,40}, 2, 50)));

    SourcePositionMap map = builder.getSourcePositionMap();
View Full Code Here

Examples of org.chromium.debug.core.model.VmResourceId

  }

  private static SourcePosition checkOneWay(SourcePositionMap map,
      String fromFile, int fromLine, int fromColumn,
      String toFile, int toLine, int toColumn, TranslateDirection direction) {
    SourcePosition result = map.translatePosition(new VmResourceId(fromFile, null),
        fromLine, fromColumn, direction);
    Assert.assertEquals(new SourcePosition(new VmResourceId(toFile, null), toLine, toColumn),
        result);
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.