Ejemplo n.º 1
0
  public static VariableCollector createCollector(
      DartiumDebugTarget target,
      WebkitRemoteObject thisObject,
      List<WebkitRemoteObject> remoteObjects,
      WebkitRemoteObject libraryObject,
      WebkitRemoteObject exception) {
    final VariableCollector collector = new VariableCollector(target, remoteObjects.size());

    if (exception != null) {
      collector.createExceptionVariable(exception);
    }

    if (libraryObject != null) {
      collector.createLibraryVariable(libraryObject);
    }

    if (thisObject != null) {
      collector.createThisVariable(thisObject);
    }

    for (final WebkitRemoteObject obj : remoteObjects) {
      try {
        target
            .getConnection()
            .getRuntime()
            .getProperties(
                obj,
                true,
                new WebkitCallback<WebkitPropertyDescriptor[]>() {
                  @Override
                  public void handleResult(WebkitResult<WebkitPropertyDescriptor[]> result) {
                    try {
                      collector.collectFields(result, false, !obj.isList());
                    } catch (Throwable t) {
                      DartDebugCorePlugin.logError(t);

                      collector.worked();
                    }
                  }
                });
      } catch (Throwable e) {
        DartDebugCorePlugin.logError(e);

        collector.worked();
      }
    }

    return collector;
  }
Ejemplo n.º 2
0
  @SuppressWarnings("unused")
  private boolean collectStaticFields(
      final WebkitRemoteObject classInfo, final CountDownLatch latch) {
    try {
      target
          .getConnection()
          .getRuntime()
          .getProperties(
              classInfo,
              true,
              new WebkitCallback<WebkitPropertyDescriptor[]>() {
                @Override
                public void handleResult(WebkitResult<WebkitPropertyDescriptor[]> result) {
                  collectStaticFieldsResults(result, latch);
                }
              });

      return true;
    } catch (IOException e) {
      return false;
    }
  }
Ejemplo n.º 3
0
  public static VariableCollector createCollector(
      DartiumDebugTarget target,
      DartiumDebugVariable variable,
      List<WebkitRemoteObject> remoteObjects) {
    final VariableCollector collector =
        new VariableCollector(target, remoteObjects.size(), variable);

    for (final WebkitRemoteObject obj : remoteObjects) {
      try {
        target
            .getConnection()
            .getRuntime()
            .getProperties(
                obj,
                true,
                new WebkitCallback<WebkitPropertyDescriptor[]>() {
                  @Override
                  public void handleResult(WebkitResult<WebkitPropertyDescriptor[]> result) {
                    try {
                      collector.collectFields(result, !obj.isList(), !obj.isList());
                    } catch (Throwable t) {
                      DartDebugCorePlugin.logError(t);

                      collector.worked();
                    }
                  }
                });
      } catch (Throwable e) {
        DartDebugCorePlugin.logError(e);

        collector.worked();
      }
    }

    return collector;
  }