Package org.chromium.sdk

Examples of org.chromium.sdk.JsObjectProperty


      for (PropertyDescriptorValue propertyDescriptor : propertyList) {
        String name = propertyDescriptor.name();
        boolean isInternal = INTERNAL_PROPERTY_NAME.contains(name);

        JsObjectProperty property = valueBuilder.createObjectProperty(propertyDescriptor,
            objectId, name);
        if (isInternal) {
          internalProperties.add(property);
        } else {
          properties.add(property);
        }
      }

      if (internalPropertyList != null) {
        for (InternalPropertyDescriptorValue propertyDescriptor : internalPropertyList) {
          String name = propertyDescriptor.name();

          JsVariable variable =
              valueBuilder.createVariable(propertyDescriptor.value(), name);
          internalProperties.add(variable);
        }
      }

      final ObjectProperties result = new ObjectProperties() {
        private volatile Map<String, JsVariable> propertyMap = null;

        @Override
        public List<? extends JsObjectProperty> properties() {
          return properties;
        }

        @Override
        public List<? extends JsVariable> internalProperties() {
          return internalProperties;
        }

        @Override
        public JsVariable getProperty(String name) {
          Map<String, JsVariable> map = propertyMap;
          if (map == null) {
            List<? extends JsVariable> list = properties();
            map = new HashMap<String, JsVariable>(list.size());
            for (JsVariable property : list) {
              map.put(property.getName(), property);
            }
            // Possibly overwrite other already created map, but we don't care about instance here.
            propertyMap = map;
          }
          return map.get(name);
View Full Code Here


  public static Variable forRealValue(EvaluateContext evaluateContext, JsVariable jsVariable,
      boolean isInternalProperty, ExpressionTracker.Node trackerNode) {
    ValueBase value;
    JsValue jsValue = jsVariable.getValue();
    if (jsValue == null) {
      JsObjectProperty objectProperty = jsVariable.asObjectProperty();
      if (objectProperty == null) {
        value = new ValueBase.ErrorMessageValue(evaluateContext,
            "Variable value is unavailable");
      } else {
        // This is blocking. Consider making this call async and the entire method async
View Full Code Here

            };
            return declarative.setValue(newValue, rawCallback, syncCallback);
          }
        };
      }
      JsObjectProperty property = jsVariable.asObjectProperty();
      if (property != null) {
        // TODO: implement object property setting with brute-force property assignment.
        //       Note, that correct object instance is required (not a proto object instance).
        return null;
      }
View Full Code Here

        boolean isInternal = INTERNAL_PROPERTY_NAME.contains(name);

        ValueNameBuilder valueNameBuilder =
            WipExpressionBuilder.createValueOfPropertyNameBuilder(name, propertyNameBuilder);

        JsObjectProperty property = valueBuilder.createObjectProperty(propertyDescriptor,
            objectId, valueNameBuilder);
        if (isInternal) {
          internalProperties.add(property);
        } else {
          properties.add(property);
        }
      }

      final ObjectProperties result = new ObjectProperties() {
        private volatile Map<String, JsVariable> propertyMap = null;

        @Override
        public List<? extends JsObjectProperty> properties() {
          return properties;
        }

        @Override
        public List<? extends JsVariable> internalProperties() {
          return internalProperties;
        }

        @Override
        public JsVariable getProperty(String name) {
          Map<String, JsVariable> map = propertyMap;
          if (map == null) {
            List<? extends JsVariable> list = properties();
            map = new HashMap<String, JsVariable>(list.size());
            for (JsVariable property : list) {
              map.put(property.getName(), property);
            }
            // Possibly overwrite other already created map, but we don't care about instance here.
            propertyMap = map;
          }
          return map.get(name);
View Full Code Here

        boolean isInternal = INTERNAL_PROPERTY_NAME.contains(name);

        ValueNameBuilder valueNameBuilder =
            WipExpressionBuilder.createValueOfPropertyNameBuilder(name, propertyNameBuilder);

        JsObjectProperty property = valueBuilder.createObjectProperty(propertyDescriptor,
            objectId, valueNameBuilder);
        if (isInternal) {
          internalProperties.add(property);
        } else {
          properties.add(property);
        }
      }

      final ObjectProperties result = new ObjectProperties() {
        private volatile Map<String, JsVariable> propertyMap = null;

        @Override
        public List<? extends JsObjectProperty> properties() {
          return properties;
        }

        @Override
        public List<? extends JsVariable> internalProperties() {
          return internalProperties;
        }

        @Override
        public JsVariable getProperty(String name) {
          Map<String, JsVariable> map = propertyMap;
          if (map == null) {
            List<? extends JsVariable> list = properties();
            map = new HashMap<String, JsVariable>(list.size());
            for (JsVariable property : list) {
              map.put(property.getName(), property);
            }
            // Possibly overwrite other already created map, but we don't care about instance here.
            propertyMap = map;
          }
          return map.get(name);
View Full Code Here

      boolean isInternalProperty, Real.HostObject hostObject) {
    ValueBase value;
    if (jsVariable.isReadable()) {
      JsValue jsValue = jsVariable.getValue();
      if (jsValue == null) {
        JsObjectProperty objectProperty = jsVariable.asObjectProperty();
        if (objectProperty == null) {
          value = new ValueBase.ErrorMessageValue(evaluateContext,
              "Variable value is unavailable");
        } else {
          // This is blocking. Consider making this call async and the entire method async
View Full Code Here

TOP

Related Classes of org.chromium.sdk.JsObjectProperty

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.