Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
wspinfoservice.cpp File Reference
#include "nsIVariant.h"
#include "wspprivate.h"

Go to the source code of this file.

Classes

class  IIDX
class  ParamAccumulator

Functions

static nsresult NewUniqueID (nsID *aID)
static nsresult FindInterfaceByName (const char *aName, nsIInterfaceInfoSuperManager *iism, nsIInterfaceInfoManager **aSet, nsIInterfaceInfo **_retval)
static nsresult FindInterfaceIndexByName (const char *aName, nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *aSet, PRUint16 *aIndex)
static nsresult AppendStandardInterface (const nsIID &iid, nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *set, PRUint16 *aIndex)
static void BuildInterfaceName (const nsAString &qualifier, const nsAString &name, const nsAString &uri, nsACString &aCIdentifier)
static nsresult AppendMethodsForModelGroup (nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *aSet, nsISchemaModelGroup *aModelGroup, const IIDX &iidx, XPTParamDescriptor *defaultResult, nsIGenericInterfaceInfo *aInfo, const nsAString &qualifier)
static nsresult GetParamDescOfType (nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *aSet, nsISchemaType *aType, const IIDX &iidx, XPTParamDescriptor *defaultResult, const nsAString &qualifier, PRUint32 depth, ParamAccumulator *aParams)
static nsresult AppendMethodForParticle (nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *aSet, nsISchemaParticle *aParticle, const IIDX &iidx, XPTParamDescriptor *defaultResult, nsIGenericInterfaceInfo *aInfo, const nsAString &qualifier)
static nsresult FindOrConstructInterface (nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *aSet, nsISchemaComplexType *aComplexType, nsISchemaModelGroup *aModelGroup, const IIDX &iidx, XPTParamDescriptor *defaultResult, const nsAString &qualifier, PRUint16 *aTypeIndex)
static nsresult GetParamDescOfPart (nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *aSet, nsIWSDLPart *aPart, const IIDX &iidx, XPTParamDescriptor *defaultResult, const nsAString &qualifier, ParamAccumulator *aParams)
static nsresult AccumulateParamsForMessage (nsIInterfaceInfoSuperManager *iism, nsIGenericInterfaceInfoSet *aSet, nsIWSDLMessage *aMsg, const IIDX &iidx, XPTParamDescriptor *defaultResult, const nsAString &qualifier, ParamAccumulator *aParams)

Function Documentation

static nsresult AccumulateParamsForMessage ( nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet aSet,
nsIWSDLMessage aMsg,
const IIDX iidx,
XPTParamDescriptor defaultResult,
const nsAString &  qualifier,
ParamAccumulator aParams 
) [static]

Definition at line 831 of file wspinfoservice.cpp.

{
  nsresult rv;
  PRUint32 partCount;
  
  rv = aMsg->GetPartCount(&partCount);
  if (NS_FAILED(rv)) {
    return rv;
  }

  for (PRUint32 i = 0; i < partCount; i++) {
    nsCOMPtr<nsIWSDLPart> part;
    rv = aMsg->GetPart(i, getter_AddRefs(part));
    if (NS_FAILED(rv)) {
      return rv;
    }

    // Accumulate paramDescriptors (except some flags). This might include
    // constructing a nested set of compound types and adding them
    // to the set.

    rv = GetParamDescOfPart(iism, aSet, part, iidx, defaultResult, qualifier,
                            aParams);
    if (NS_FAILED(rv)) {
      return rv;
    }
  }
  return NS_OK;
}  

Here is the call graph for this function:

static nsresult AppendMethodForParticle ( nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet aSet,
nsISchemaParticle aParticle,
const IIDX iidx,
XPTParamDescriptor defaultResult,
nsIGenericInterfaceInfo aInfo,
const nsAString &  qualifier 
) [static]

Definition at line 301 of file wspinfoservice.cpp.

{
  nsresult rv;
  XPTMethodDescriptor methodDesc;
  XPTParamDescriptor* pparamDesc;
  PRUint16 ignoredIndex;
  XPTParamDescriptor* paramArray;
  ParamAccumulator params;
  PRUint16 i;

  // If the particle is itself a modelGroup, then flatten in its methods.
  nsCOMPtr<nsISchemaModelGroup> modelGroup(do_QueryInterface(aParticle));
  if (modelGroup) {
    return AppendMethodsForModelGroup(iism, aSet, modelGroup, iidx, 
                                      defaultResult, aInfo, qualifier);
  }
  // else...

  nsCOMPtr<nsISchemaElement> schemaElement(do_QueryInterface(aParticle));
  if (!schemaElement) {
    // XXX we are considering this an error. (e.g is a nsISchemaAnyParticle).
    // XXX need better error tracking!
    return NS_ERROR_UNEXPECTED;
  }

  nsCOMPtr<nsISchemaType> schemaType;
  schemaElement->GetType(getter_AddRefs(schemaType));
  if (!schemaType) {
    // XXX need better error tracking!
    return NS_ERROR_UNEXPECTED;
  }

  nsAutoString name;
  rv = aParticle->GetName(name);
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCAutoString identifierName;
  WSPFactory::XML2C(name, identifierName);

  rv = GetParamDescOfType(iism, aSet, schemaType, iidx, defaultResult,
                          qualifier, 0, &params);
  if (NS_FAILED(rv)) {
    return rv;
  }

  rv = aSet->AllocateParamArray(params.GetCount(), &paramArray);
  if (NS_FAILED(rv)) {
    return rv;
  }

  pparamDesc = params.GetArray();
  for (i = 0; i < params.GetCount(); pparamDesc++, i++) {
    // handle AString 'out' passing convensions
    pparamDesc->flags |=
      (XPT_TDP_TAG(pparamDesc->type.prefix) == TD_DOMSTRING) ?
          (XPT_PD_IN | XPT_PD_DIPPER) : XPT_PD_OUT;

    // handle array size_of/length_of.
    if (XPT_TDP_TAG(pparamDesc->type.prefix) == TD_ARRAY) {
      pparamDesc->type.argnum = 
          pparamDesc->type.argnum2 = i - 1; 
    }
    
    // handle trailing retval.
    if (i+1 == params.GetCount()) {
      pparamDesc->flags |= XPT_PD_RETVAL;
    }
  }

  memcpy(paramArray, params.GetArray(), 
         params.GetCount() * sizeof(XPTParamDescriptor));

  // XXX conditionally tack on 'Get' for array getter?
  // XXX Deal with intercaps in that case?

  methodDesc.flags    = params.GetCount() == 1 ? XPT_MD_GETTER : 0;
  methodDesc.name     = NS_CONST_CAST(char*, identifierName.get());
  methodDesc.params   = paramArray;
  methodDesc.result   = defaultResult;
  methodDesc.num_args = (PRUint8) params.GetCount();

  return aInfo->AppendMethod(&methodDesc, &ignoredIndex);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult AppendMethodsForModelGroup ( nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet aSet,
nsISchemaModelGroup aModelGroup,
const IIDX iidx,
XPTParamDescriptor defaultResult,
nsIGenericInterfaceInfo aInfo,
const nsAString &  qualifier 
) [static]

Definition at line 397 of file wspinfoservice.cpp.

{
  nsresult rv;
  PRUint32 particleCount;
  rv = aModelGroup->GetParticleCount(&particleCount);
  if (NS_FAILED(rv)) {
    return rv;
  }

  for (PRUint32 i = 0; i < particleCount; i++) {
    nsCOMPtr<nsISchemaParticle> particle;
    rv = aModelGroup->GetParticle(i, getter_AddRefs(particle));
    if (NS_FAILED(rv)) {
      return rv;
    }

    rv = AppendMethodForParticle(iism, aSet, particle, iidx, defaultResult,
                                 aInfo, qualifier);
    if (NS_FAILED(rv)) {
      return rv;
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult AppendStandardInterface ( const nsIID iid,
nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet set,
PRUint16 aIndex 
) [static]

Definition at line 242 of file wspinfoservice.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIInterfaceInfo> tempInfo;

  rv = iism->GetInfoForIID(&iid, getter_AddRefs(tempInfo));
  if (NS_FAILED(rv)) {
    return rv;
  }

  return set->AppendExternalInterface(tempInfo, aIndex);
}

Here is the call graph for this function:

static void BuildInterfaceName ( const nsAString &  qualifier,
const nsAString &  name,
const nsAString &  uri,
nsACString &  aCIdentifier 
) [static]

Definition at line 261 of file wspinfoservice.cpp.

{
  WSPFactory::XML2C(qualifier, aCIdentifier);

  nsCAutoString temp;
  WSPFactory::XML2C(name, temp);
  aCIdentifier.Append(temp);

  WSPFactory::XML2C(uri, temp);
  aCIdentifier.Append(temp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult FindInterfaceByName ( const char *  aName,
nsIInterfaceInfoSuperManager iism,
nsIInterfaceInfoManager **  aSet,
nsIInterfaceInfo **  _retval 
) [static]

Definition at line 182 of file wspinfoservice.cpp.

{
  NS_ENSURE_ARG_POINTER(aSet);
  if (NS_SUCCEEDED(iism->GetInfoForName(aName, _retval)) && *_retval) {
    NS_ADDREF(*aSet = iism);
    return NS_OK;
  }

  PRBool yes;
  nsCOMPtr<nsISimpleEnumerator> list;

  if (NS_SUCCEEDED(iism->HasAdditionalManagers(&yes)) && yes &&
      NS_SUCCEEDED(iism->EnumerateAdditionalManagers(getter_AddRefs(list))) &&
      list) {
    PRBool more;
    nsCOMPtr<nsIInterfaceInfoManager> current;

    while (NS_SUCCEEDED(list->HasMoreElements(&more)) && more &&
           NS_SUCCEEDED(list->GetNext(getter_AddRefs(current))) && current) {
      if (NS_SUCCEEDED(current->GetInfoForName(aName, _retval)) &&
          *_retval) {
        NS_ADDREF(*aSet = current.get());
        return NS_OK;
      }
    }
  }

  return NS_ERROR_NO_INTERFACE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult FindInterfaceIndexByName ( const char *  aName,
nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet aSet,
PRUint16 aIndex 
) [static]

Definition at line 218 of file wspinfoservice.cpp.

{
  nsresult rv = aSet->IndexOfByName(aName, aIndex);
  if (NS_SUCCEEDED(rv)) {
    return NS_OK;
  }

  nsCOMPtr<nsIInterfaceInfo> info;
  nsCOMPtr<nsIInterfaceInfoManager> unused;
  rv = FindInterfaceByName(aName, iism, getter_AddRefs(unused), getter_AddRefs(info));
  if (NS_FAILED(rv)) {
    return rv;
  }

  return aSet->AppendExternalInterface(info, aIndex);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult FindOrConstructInterface ( nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet aSet,
nsISchemaComplexType aComplexType,
nsISchemaModelGroup aModelGroup,
const IIDX iidx,
XPTParamDescriptor defaultResult,
const nsAString &  qualifier,
PRUint16 aTypeIndex 
) [static]

Definition at line 434 of file wspinfoservice.cpp.

{
  nsresult rv;
  nsCAutoString qualifiedName;
  nsAutoString name;
  nsAutoString ns;
  nsCOMPtr<nsIGenericInterfaceInfo> newInfo;
  nsID tempID;
  PRBool haveUniqueID = PR_FALSE;
  
  rv = aComplexType->GetName(name);
  if (NS_FAILED(rv)) {
    return rv;
  }

  if (name.IsEmpty()) {
    // Fabricate a unique name for anonymous type.
    // Bug 199555
    ::NewUniqueID(&tempID);
    nsXPIDLCString idStr;
    idStr += tempID.ToString();
    name.AssignWithConversion(idStr);
    haveUniqueID = PR_TRUE;
  }
  else {
   rv = aComplexType->GetTargetNamespace(ns);
    if (NS_FAILED(rv)) {
      return rv;
    }
  }

  BuildInterfaceName(qualifier, name, ns, qualifiedName);

  // Does the interface already exist?

  rv = FindInterfaceIndexByName(qualifiedName.get(), iism, aSet, aTypeIndex);
  if (NS_SUCCEEDED(rv)) {
    return NS_OK;
  }

  // Need to create the interface.

  if (!haveUniqueID)
    ::NewUniqueID(&tempID);
  rv = aSet->CreateAndAppendInterface(qualifiedName.get(), tempID,
                                      iidx.Get(IIDX::IDX_nsISupports),
                                      XPT_ID_SCRIPTABLE,
                                      getter_AddRefs(newInfo),
                                      aTypeIndex);
  if (NS_FAILED(rv)) {
    return rv;
  }

  return AppendMethodsForModelGroup(iism, aSet, aModelGroup, iidx, 
                                    defaultResult, newInfo, qualifier);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult GetParamDescOfPart ( nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet aSet,
nsIWSDLPart aPart,
const IIDX iidx,
XPTParamDescriptor defaultResult,
const nsAString &  qualifier,
ParamAccumulator aParams 
) [static]

Definition at line 770 of file wspinfoservice.cpp.

{
  nsresult rv;

  // If the binding is 'literal' then we consider this as DOM element.
  nsCOMPtr<nsIWSDLBinding> binding;
  rv = aPart->GetBinding(getter_AddRefs(binding));
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr<nsISOAPPartBinding> soapPartBinding(do_QueryInterface(binding));
  if (soapPartBinding) {
    PRUint16 use;
    rv = soapPartBinding->GetUse(&use);
    if (NS_FAILED(rv)) {
      return rv;
    }

    if (use == nsISOAPPartBinding::USE_LITERAL) {
      XPTParamDescriptor* paramDesc = aParams->GetNextParam();
      if (!paramDesc) {
        return NS_ERROR_OUT_OF_MEMORY;
      }
      paramDesc->type.prefix.flags = TD_INTERFACE_TYPE | XPT_TDP_POINTER;
      paramDesc->type.type.iface = iidx.Get(IIDX::IDX_nsIDOMElement);
      return NS_OK;
    }
  }

  nsCOMPtr<nsISchemaComponent> schemaComponent;
  rv = aPart->GetSchemaComponent(getter_AddRefs(schemaComponent));
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr<nsISchemaType> type;
  nsCOMPtr<nsISchemaElement> element(do_QueryInterface(schemaComponent));
  if (element) {
    rv = element->GetType(getter_AddRefs(type));
  }
  else {
    type = do_QueryInterface(schemaComponent, &rv);
  }

  if (NS_FAILED(rv)) {
    return rv;
  }

  return GetParamDescOfType(iism, aSet, type, iidx, defaultResult, qualifier,
                            0, aParams);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult GetParamDescOfType ( nsIInterfaceInfoSuperManager iism,
nsIGenericInterfaceInfoSet aSet,
nsISchemaType aType,
const IIDX iidx,
XPTParamDescriptor defaultResult,
const nsAString &  qualifier,
PRUint32  depth,
ParamAccumulator aParams 
) [static]

Definition at line 507 of file wspinfoservice.cpp.

{
  XPTTypeDescriptor* additionalType;
  PRUint16 typeIndex;

  nsCOMPtr<nsISchemaSimpleType> simpleType;
  nsresult rv;

  XPTParamDescriptor* paramDesc = aParams->GetNextParam();
  if (!paramDesc) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  nsCOMPtr<nsISchemaComplexType> complexType(do_QueryInterface(aType));
  if (complexType) {
    PRUint16 contentModel;
    rv = complexType->GetContentModel(&contentModel);
    if (NS_FAILED(rv)) {
      return rv;
    }

    PRBool isArray;
    rv = complexType->GetIsArray(&isArray);
    if (NS_FAILED(rv)) {
      return rv;
    }

    if (isArray) {
      // Punt by calling this array an nsIVariant.
      // Fix bug 202485
      paramDesc->type.prefix.flags = TD_INTERFACE_TYPE | XPT_TDP_POINTER;
      paramDesc->type.type.iface = iidx.Get(IIDX::IDX_nsIVariant);
      return NS_OK;
    }

    switch(contentModel) {
      case nsISchemaComplexType::CONTENT_MODEL_SIMPLE:
        rv = complexType->GetSimpleBaseType(getter_AddRefs(simpleType));
        if (NS_FAILED(rv)) {
          return rv;
        }
        goto do_simple;
      case nsISchemaComplexType::CONTENT_MODEL_ELEMENT_ONLY:
      case nsISchemaComplexType::CONTENT_MODEL_MIXED:
        break;
      default:
        NS_ERROR("unexpected contentModel!");
      case nsISchemaComplexType::CONTENT_MODEL_EMPTY:
        return NS_ERROR_UNEXPECTED;
    }

    nsCOMPtr<nsISchemaModelGroup> modelGroup;
    rv = complexType->GetModelGroup(getter_AddRefs(modelGroup));
    if (NS_FAILED(rv)) {
      return rv;
    }

    PRUint16 compositor;
    rv = modelGroup->GetCompositor(&compositor);
    if (NS_FAILED(rv)) {
      return rv;
    }

    if (compositor == nsISchemaModelGroup::COMPOSITOR_CHOICE) {
      // CHOICE not supported
      return NS_ERROR_UNEXPECTED;
    }

    // XXX I *think* we can safely assume that we've already handled the case
    // where the type is an array.

    rv = FindOrConstructInterface(iism, aSet, complexType, modelGroup, iidx, 
                                  defaultResult, qualifier, &typeIndex);
    if (NS_FAILED(rv)) {
      return rv;
    }

    paramDesc->type.prefix.flags = TD_INTERFACE_TYPE | XPT_TDP_POINTER;
    paramDesc->type.type.iface = typeIndex;
    return NS_OK;
  }

  // If it is not complex it *must* be simple.

  simpleType = do_QueryInterface(aType, &rv);
do_simple:
  if (!simpleType) {
    return rv;
  }

  // We just ignore the restrictions on restrictionTypes and get at the
  // underlying simple type.

  nsCOMPtr<nsISchemaRestrictionType> restrictionType;
  while (nsnull != (restrictionType = do_QueryInterface(simpleType))) {
    rv = restrictionType->GetBaseType(getter_AddRefs(simpleType));
    if (NS_FAILED(rv)) {
      return rv;
    }
  }

  nsCOMPtr<nsISchemaBuiltinType> builtinType(do_QueryInterface(simpleType));
  if (builtinType) {
    PRUint16 typeID;
    rv = builtinType->GetBuiltinType(&typeID);
    if (NS_FAILED(rv)) {
      return rv;
    }

    switch(typeID) {
      case nsISchemaBuiltinType::BUILTIN_TYPE_ANYTYPE:
        paramDesc->type.prefix.flags = TD_INTERFACE_TYPE | XPT_TDP_POINTER;
        paramDesc->type.type.iface = iidx.Get(IIDX::IDX_nsIVariant);
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_STRING:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NORMALIZED_STRING:
      case nsISchemaBuiltinType::BUILTIN_TYPE_TOKEN:
        paramDesc->type.prefix.flags = TD_DOMSTRING | XPT_TDP_POINTER;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_BYTE:
        paramDesc->type.prefix.flags = TD_INT8;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_UNSIGNEDBYTE:
        paramDesc->type.prefix.flags = TD_UINT8;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_BASE64BINARY:
      case nsISchemaBuiltinType::BUILTIN_TYPE_HEXBINARY:
        // XXX We are treating this as an array of TD_UINT8.

        rv = aSet->AllocateAdditionalType(&typeIndex, &additionalType);
        if (NS_FAILED(rv)) {
          return rv;
        }

        // Copy the element type into the referenced additional type.
        additionalType->prefix.flags = TD_UINT8;

        // Add the leading 'length' param.
        paramDesc->type.prefix.flags = TD_UINT32;
      
        // Alloc another param descriptor to hold the array info.
        paramDesc = aParams->GetNextParam();
        if (!paramDesc) {
          return NS_ERROR_OUT_OF_MEMORY;
        }

        // Set this *second* param as an array and return.
        paramDesc->type.prefix.flags = TD_ARRAY | XPT_TDP_POINTER;
        paramDesc->type.type.additional_type = typeIndex;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_POSITIVEINTEGER:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NONNEGATIVEINTEGER:
        // XXX need a longInteger class?
        paramDesc->type.prefix.flags = TD_UINT64;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_INTEGER:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NEGATIVEINTEGER:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NONPOSITIVEINTEGER:
        // XXX need a longInteger class?
        paramDesc->type.prefix.flags = TD_INT64;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_INT:
        paramDesc->type.prefix.flags = TD_INT32;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_UNSIGNEDINT:
        paramDesc->type.prefix.flags = TD_UINT32;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_LONG:
        paramDesc->type.prefix.flags = TD_INT64;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_UNSIGNEDLONG:
        paramDesc->type.prefix.flags = TD_UINT64;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_SHORT:
        paramDesc->type.prefix.flags = TD_INT16;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_UNSIGNEDSHORT:
        paramDesc->type.prefix.flags = TD_UINT16;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_DECIMAL:
        // XXX need a decimal class?
        paramDesc->type.prefix.flags = TD_DOUBLE;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_FLOAT:
        paramDesc->type.prefix.flags = TD_FLOAT;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_DOUBLE:
        paramDesc->type.prefix.flags = TD_DOUBLE;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_BOOLEAN:
        paramDesc->type.prefix.flags = TD_BOOL;
        return NS_OK;
      case nsISchemaBuiltinType::BUILTIN_TYPE_DATETIME:
        // XXX date type?
      case nsISchemaBuiltinType::BUILTIN_TYPE_TIME:
      case nsISchemaBuiltinType::BUILTIN_TYPE_DURATION:
      case nsISchemaBuiltinType::BUILTIN_TYPE_DATE:
      case nsISchemaBuiltinType::BUILTIN_TYPE_GMONTH:
      case nsISchemaBuiltinType::BUILTIN_TYPE_GYEAR:
      case nsISchemaBuiltinType::BUILTIN_TYPE_GYEARMONTH:
      case nsISchemaBuiltinType::BUILTIN_TYPE_GDAY:
      case nsISchemaBuiltinType::BUILTIN_TYPE_GMONTHDAY:
        paramDesc->type.prefix.flags = TD_DOMSTRING | XPT_TDP_POINTER;
        return NS_OK;

      case nsISchemaBuiltinType::BUILTIN_TYPE_NAME:
      case nsISchemaBuiltinType::BUILTIN_TYPE_QNAME:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NCNAME:
      case nsISchemaBuiltinType::BUILTIN_TYPE_ANYURI:
      case nsISchemaBuiltinType::BUILTIN_TYPE_LANGUAGE:
      case nsISchemaBuiltinType::BUILTIN_TYPE_ID:
      case nsISchemaBuiltinType::BUILTIN_TYPE_IDREF:
      case nsISchemaBuiltinType::BUILTIN_TYPE_IDREFS:
      case nsISchemaBuiltinType::BUILTIN_TYPE_ENTITY:
      case nsISchemaBuiltinType::BUILTIN_TYPE_ENTITIES:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NOTATION:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NMTOKEN:
      case nsISchemaBuiltinType::BUILTIN_TYPE_NMTOKENS:
        paramDesc->type.prefix.flags = TD_DOMSTRING | XPT_TDP_POINTER;
        return NS_OK;

      default:
        NS_ERROR("unexpected typeID!");
        return NS_ERROR_UNEXPECTED;
    }
    NS_ERROR("missing return");
    return NS_ERROR_UNEXPECTED;
  }

  // else...

  nsCOMPtr<nsISchemaListType> listType(do_QueryInterface(simpleType));
  if (listType) {
    paramDesc->type.prefix.flags = TD_DOMSTRING | XPT_TDP_POINTER;
    return NS_OK;
  }

  // else...

  nsCOMPtr<nsISchemaUnionType> unionType(do_QueryInterface(simpleType));
  if (unionType) {
    paramDesc->type.prefix.flags = TD_INTERFACE_TYPE | XPT_TDP_POINTER;
    paramDesc->type.type.iface = iidx.Get(IIDX::IDX_nsIVariant);
    return NS_OK;
  }

  // else...

  NS_ERROR("unexpected simple type!");
  return NS_ERROR_UNEXPECTED;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult NewUniqueID ( nsID aID) [static]

Definition at line 159 of file wspinfoservice.cpp.

{
  // XXX Hack Alert. This was generated on jband's 'bugsfree' machine and
  // *ought* not to conflict with any existing guids. We should find a
  // more foolproof crossplatfor dynmic guidgen scheme.

  // {00000000-1063-11d6-98A8-00C04FA0D259}
  static const nsID sBaseGuid =
    {0x00000000, 0x1063, 0x11d6,
      {0x98, 0xa8, 0x0, 0xc0, 0x4f, 0xa0, 0xd2, 0x59}};

  static PRInt32 sSerialNumber = 0;

  *aID = sBaseGuid;
  aID->m0 = (PRUint32) PR_AtomicIncrement(&sSerialNumber);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function: