Ejemplo n.º 1
0
NS_IMETHODIMP
LoadInfo::SetScriptableOriginAttributes(JSContext* aCx,
                                        JS::Handle<JS::Value> aOriginAttributes)
{
    OriginAttributes attrs;
    if (!aOriginAttributes.isObject() || !attrs.Init(aCx, aOriginAttributes)) {
        return NS_ERROR_INVALID_ARG;
    }

    mOriginAttributes = attrs;
    return NS_OK;
}
Ejemplo n.º 2
0
NS_IMETHODIMP LoadContextInfoFactory::Custom(bool aAnonymous,
                                             JS::HandleValue aOriginAttributes, JSContext *cx,
                                             nsILoadContextInfo * *_retval)
{
  OriginAttributes attrs;
  bool status = attrs.Init(cx, aOriginAttributes);
  NS_ENSURE_TRUE(status, NS_ERROR_FAILURE);

  nsCOMPtr<nsILoadContextInfo> info = GetLoadContextInfo(aAnonymous, attrs);
  info.forget(_retval);
  return NS_OK;
}