Beispiel #1
0
void CSMSettings::Setting::addProxy (const Setting *setting,
                                     const QList <QStringList> &list)
{
    if (serializable())
        setProperty (Property_Serializable, false);

    mProxies [setting->page() + '/' + setting->name()] = list;
}
Beispiel #2
0
void CSMSettings::Setting::addProxy (const Setting *setting,
                                     const QStringList &vals)
{
    if (serializable())
        setSerializable (false);

    QList <QStringList> list;

    foreach  (const QString &val, vals)
        list << (QStringList() << val);

    mProxies [setting->page() + '/' + setting->name()] = list;
}
NS_IMETHODIMP
TransportSecurityInfo::Write(nsIObjectOutputStream* stream)
{
  nsresult rv = stream->WriteID(kTransportSecurityInfoMagic);
  if (NS_FAILED(rv)) {
    return rv;
  }

  MutexAutoLock lock(mMutex);

  rv = stream->Write32(mSecurityState);
  if (NS_FAILED(rv)) {
    return rv;
  }
  rv = stream->Write32(mSubRequestsBrokenSecurity);
  if (NS_FAILED(rv)) {
    return rv;
  }
  rv = stream->Write32(mSubRequestsNoSecurity);
  if (NS_FAILED(rv)) {
    return rv;
  }
  // XXX: uses nsNSSComponent string bundles off the main thread
  rv = formatErrorMessage(lock, mErrorCode, mErrorMessageType, true, true,
                          mErrorMessageCached);
  if (NS_FAILED(rv)) {
    return rv;
  }
  rv = stream->WriteWStringZ(mErrorMessageCached.get());
  if (NS_FAILED(rv)) {
    return rv;
  }
  nsCOMPtr<nsISerializable> serializable(mSSLStatus);
  rv = stream->WriteCompoundObject(serializable, NS_GET_IID(nsISSLStatus),
                                   true);
  if (NS_FAILED(rv)) {
    return rv;
  }
  return NS_OK;
}
NS_IMETHODIMP
TransportSecurityInfo::Write(nsIObjectOutputStream* stream)
{
    nsresult rv = stream->WriteID(kTransportSecurityInfoMagic);
    if (NS_FAILED(rv)) {
        return rv;
    }

    MutexAutoLock lock(mMutex);

    rv = stream->Write32(mSecurityState);
    if (NS_FAILED(rv)) {
        return rv;
    }
    rv = stream->Write32(mSubRequestsBrokenSecurity);
    if (NS_FAILED(rv)) {
        return rv;
    }
    rv = stream->Write32(mSubRequestsNoSecurity);
    if (NS_FAILED(rv)) {
        return rv;
    }
    rv = stream->Write32(static_cast<uint32_t>(mErrorCode));
    if (NS_FAILED(rv)) {
        return rv;
    }
    if (mErrorMessageCached.IsEmpty()) {
        // XXX: uses nsNSSComponent string bundles off the main thread
        rv = formatErrorMessage(lock, mErrorCode, mErrorMessageType,
                                true, true, mErrorMessageCached);
        if (NS_FAILED(rv)) {
            return rv;
        }
    }
    rv = stream->WriteWStringZ(mErrorMessageCached.get());
    if (NS_FAILED(rv)) {
        return rv;
    }

    // For successful connections and for connections with overridable errors,
    // mSSLStatus will be non-null. However, for connections with non-overridable
    // errors, it will be null.
    nsCOMPtr<nsISerializable> serializable(mSSLStatus);
    rv = NS_WriteOptionalCompoundObject(stream,
                                        serializable,
                                        NS_GET_IID(nsISSLStatus),
                                        true);
    if (NS_FAILED(rv)) {
        return rv;
    }

    rv = NS_WriteOptionalCompoundObject(stream,
                                        mFailedCertChain,
                                        NS_GET_IID(nsIX509CertList),
                                        true);
    if (NS_FAILED(rv)) {
        return rv;
    }

    return NS_OK;
}