コード例 #1
0
  private void collectFields(
      WebkitResult<WebkitPropertyDescriptor[]> results,
      boolean shouldSort,
      boolean collectStatics) {
    boolean gettingStaticFields = false;

    if (!results.isError()) {
      WebkitPropertyDescriptor[] properties = results.getResult();

      if (shouldSort) {
        properties = sort(properties);
      }

      webkitProperties = Arrays.asList(properties);

      for (WebkitPropertyDescriptor descriptor : properties) {
        if (descriptor.isEnumerable()) {
          if (!shouldFilter(descriptor)) {
            DartiumDebugVariable variable = new DartiumDebugVariable(target, descriptor);

            if (parentVariable != null) {
              variable.setParent(parentVariable);
            }

            variables.add(variable);
          }
        } else {
          // Static fields are now shown using the object inspector (Inspect Type...).
          //          if (parentVariable != null && collectStatics) {
          //            if (WebkitPropertyDescriptor.STATIC_FIELDS.equals(descriptor.getName())) {
          //              gettingStaticFields = collectStaticFields(descriptor.getValue(), latch);
          //            }
          //          }
        }
      }
    }

    if (!gettingStaticFields) {
      latch.countDown();
    }
  }
コード例 #2
0
  private void collectStaticFieldsResults(
      WebkitResult<WebkitPropertyDescriptor[]> results, CountDownLatch latch) {
    try {
      if (!results.isError()) {
        for (WebkitPropertyDescriptor descriptor : sort(results.getResult())) {
          if (descriptor.isEnumerable()) {
            DartiumDebugVariable variable = new DartiumDebugVariable(target, descriptor);

            variable.setIsStatic(true);

            if (parentVariable != null) {
              variable.setParent(parentVariable);
            }

            variables.add(variable);
          }
        }
      }
    } finally {
      latch.countDown();
    }
  }