Package org.chromium.sdk

Examples of org.chromium.sdk.JsObject


      return new DeferredData(jsValue);
    }

    @Override
    public JsObject getScopeObject() throws MethodIsBlockingException {
      JsObject asObject = getDeferredData().jsValue.asObject();
      if (asObject == null) {
        throw new RuntimeException("Received scope object value is not an object");
      }
      return asObject;
    }
View Full Code Here


    @Override
    protected List<? extends JsVariable> getVariables(DeferredData data)
        throws MethodIsBlockingException {
      if (data.orderedProperties == null) {
        List<? extends JsVariable> list;
        JsObject jsObject = data.jsValue.asObject();
        if (jsObject == null) {
          list = Collections.emptyList();
        } else {
          list = new ArrayList<JsVariable>(jsObject.getProperties());
        }
        data.orderedProperties = list;
      }
      return data.orderedProperties;
    }
View Full Code Here

    }
    JsValue jsValue = uiValue.getJsValue();
    if (jsValue == null) {
      return null;
    }
    JsObject jsObject = jsValue.asObject();
    if (jsObject == null) {
      return null;
    }
    return jsObject.asFunction();
  }
View Full Code Here

  }

  // This method could be blocking -- it gets called from a worker thread.
  // All data should be prepared here.
  protected IVariable[] calculateVariables() {
    JsObject asObject = value.asObject();
    if (asObject == null) {
      return EMPTY_VARIABLES;
    }
    List<Variable> functionScopes = calculateFunctionScopesVariable(asObject);
    return StackFrame.wrapVariables(getEvaluateContext(),
        asObject.getProperties(), Collections.<String>emptySet(),
        asObject.getInternalProperties(), hostObject, functionScopes);
  }
View Full Code Here

      DetailWrapper alreadyCalculatedDetail = this.detailWrapper;
      if (alreadyCalculatedDetail != NO_DETAILS_WRAPPER) {
        listener.detailComputed(Value.this, alreadyCalculatedDetail.getStringValue());
        return;
      }
      JsObject jsObject = getJsValue().asObject();
      if (jsObject == null) {
        jsValueDetailIsBuilt(getJsValue(), listener);
        return;
      }
      String objectRefId = jsObject.getRefId();
      if (objectRefId == null) {
        stringDetailIsBuilt("", listener);
        return;
      }
View Full Code Here

    JsValue exceptionValue = valueBuilder.wrap(valueData, null);

    final JsVariable property =
        WipValueBuilder.createVariable(exceptionValue, EVALUATE_EXCEPTION_INNER_NAME);

    JsObject wrapperValue = new JsObject() {
      @Override
      public RelayOk reloadHeavyValue(ReloadBiggerCallback callback,
          SyncCallback syncCallback) {
        throw new UnsupportedOperationException();
      }
View Full Code Here

        return this;
      }

      @Override
      public List<? extends JsVariable> getVariables() throws MethodIsBlockingException {
        JsObject asObject = jsValue.asObject();
        if (asObject == null) {
          return Collections.emptyList();
        }
        return new ArrayList<JsVariable>(asObject.getProperties());
      }
View Full Code Here

        return propertyDescriptor.enumerable() == Boolean.TRUE;
      }

      @Override
      public JsFunction getGetterAsFunction() {
        JsObject getterObject = getter.asObject();
        if (getterObject == null) {
          return null;
        }
        return getterObject.asFunction();
      }

      @Override
      public RelayOk evaluateGet(EvaluateCallback callback, SyncCallback syncCallback) {
        WipContextBuilder.GlobalEvaluateContext evaluateContext =
View Full Code Here

    {
      DebugContext context = stateManager.expectEvent(EXPECT_SUSPENDED_VISITOR);

      {
        // Check cache dropping.
        JsObject root = evaluateSync(context.getGlobalEvaluateContext(),
            "(debug_value_1 = {a:2})").getValue().asObject();
        if (root == null) {
          throw new RuntimeException();
        }
        String aValue;
        aValue = root.getProperty("a").getValue().getValueString();
        if (!"2".equals(aValue)) {
          throw new SmokeException();
        }
        evaluateSync(context.getGlobalEvaluateContext(), "debug_value_1.a = 3");

        root.getRemoteValueMapping().clearCaches();

        aValue = root.getProperty("a").getValue().getValueString();
        if (!"3".equals(aValue)) {
          throw new SmokeException();
        }
      }
View Full Code Here

      return this;
    }

    @Override
    public List<? extends JsVariable> getVariables() throws MethodIsBlockingException {
      JsObject asObject = jsValue.asObject();
      if (asObject == null) {
        return Collections.emptyList();
      }
      return new ArrayList<JsVariable>(asObject.getProperties());
    }
View Full Code Here

TOP

Related Classes of org.chromium.sdk.JsObject

Copyright © 2018 www.massapicom. 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.