void NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob(const Vector<String>& filePaths, const SandboxExtension::HandleArray& handles)
{
    ASSERT(filePaths.size() == handles.size());

    for (size_t i = 0; i < filePaths.size(); ++i)
        m_blobDataFileReferences.add(filePaths[i], BlobDataFileReferenceWithSandboxExtension::create(filePaths[i], SandboxExtension::create(handles[i])));
}
Ejemplo n.º 2
0
bool NetworkResourceLoadParameters::decode(IPC::ArgumentDecoder& decoder, NetworkResourceLoadParameters& result)
{
    if (!decoder.decode(result.identifier))
        return false;

    if (!decoder.decode(result.webPageID))
        return false;

    if (!decoder.decode(result.webFrameID))
        return false;

    if (!decoder.decode(result.sessionID))
        return false;

    if (!decoder.decode(result.request))
        return false;

    bool hasHTTPBody;
    if (!decoder.decode(hasHTTPBody))
        return false;

    if (hasHTTPBody) {
        RefPtr<FormData> formData = FormData::decode(decoder);
        if (!formData)
            return false;
        result.request.setHTTPBody(WTFMove(formData));

        SandboxExtension::HandleArray requestBodySandboxExtensionHandles;
        if (!decoder.decode(requestBodySandboxExtensionHandles))
            return false;
        for (size_t i = 0; i < requestBodySandboxExtensionHandles.size(); ++i) {
            if (RefPtr<SandboxExtension> extension = SandboxExtension::create(requestBodySandboxExtensionHandles[i]))
                result.requestBodySandboxExtensions.append(extension.release());
        }
    }

    if (result.request.url().isLocalFile()) {
        SandboxExtension::Handle resourceSandboxExtensionHandle;
        if (!decoder.decode(resourceSandboxExtensionHandle))
            return false;
        result.resourceSandboxExtension = SandboxExtension::create(resourceSandboxExtensionHandle);
    }

    if (!decoder.decodeEnum(result.contentSniffingPolicy))
        return false;
    if (!decoder.decodeEnum(result.allowStoredCredentials))
        return false;
    if (!decoder.decodeEnum(result.clientCredentialPolicy))
        return false;
    if (!decoder.decode(result.shouldClearReferrerOnHTTPSToHTTPRedirect))
        return false;
    if (!decoder.decode(result.defersLoading))
        return false;
    if (!decoder.decode(result.needsCertificateInfo))
        return false;
    if (!decoder.decode(result.maximumBufferingTime))
        return false;

    return true;
}
Ejemplo n.º 3
0
void WebIDBConnectionToServer::didGetRecordWithSandboxExtensions(const WebCore::IDBResultData& result, const SandboxExtension::HandleArray& handles)
{
    const auto& filePaths = result.getResult().value().blobFilePaths();

    ASSERT(filePaths.size() == handles.size());

    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, handles), 0);

    m_connectionToServer->didGetRecord(result);
}