示例#1
0
void ReadableStream::readInternalPostAction()
{
    ASSERT(m_state == Readable);
    if (isQueueEmpty() && m_isDraining)
        closeInternal();
    callPullIfNeeded();
}
示例#2
0
void ReadableStream::close()
{
    if (m_state != Readable)
        return;

    if (isQueueEmpty())
        closeInternal();
    else
        m_isDraining = true;
}
示例#3
0
bool AbstractDb::closeQuiet()
{
    QWriteLocker locker(&dbOperLock);
    QWriteLocker connectionLocker(&connectionStateLock);
    interruptExecution();
    bool res = closeInternal();
    clearAttaches();
    registeredFunctions.clear();
    registeredCollations.clear();
    if (FUNCTIONS) // FUNCTIONS is already null when closing db while closing entire app
        disconnect(FUNCTIONS, SIGNAL(functionListChanged()), this, SLOT(registerAllFunctions()));

    return res;
}
示例#4
0
void WebSocket::close(unsigned short code, ExceptionCode& ec)
{
    closeInternal(code, String(), ec);
}
示例#5
0
void WebSocket::close(ExceptionCode& ec)
{
    closeInternal(WebSocketChannel::CloseEventCodeNotSpecified, String(), ec);
}
示例#6
0
void WebSocket::close(unsigned short code, const String& reason, ExceptionCode& ec)
{
    closeInternal(code, reason, ec);
}
DnDURIObject::~DnDURIObject(void)
{
    closeInternal();
}
/**
 * Closes the object.
 * This also closes the internal handles associated with the object (to files / ...).
 */
void DnDURIObject::Close(void)
{
    closeInternal();
}
示例#9
0
int DnDURIObject::Read(void *pvBuf, uint32_t cbToRead, uint32_t *pcbRead)
{
    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
    AssertReturn(cbToRead, VERR_INVALID_PARAMETER);
    /* pcbRead is optional. */

    int rc;
    switch (m_Type)
    {
        case File:
        {
            if (!u.m_hFile)
            {
                /* Open files on the source with RTFILE_O_DENY_WRITE to prevent races
                 * where the OS writes to the file while the destination side transfers
                 * it over. */
                rc = RTFileOpen(&u.m_hFile, m_strSrcPath.c_str(),
                                RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);
            }
            else
                rc = VINF_SUCCESS;

            bool fDone = false;
            if (RT_SUCCESS(rc))
            {
                size_t cbRead;
                rc = RTFileRead(u.m_hFile, pvBuf, cbToRead, &cbRead);
                if (RT_SUCCESS(rc))
                {
                    if (pcbRead)
                        *pcbRead = (uint32_t)cbRead;

                    m_cbProcessed += cbRead;
                    Assert(m_cbProcessed <= m_cbSize);

                    /* End of file reached or error occurred? */
                    if (   m_cbProcessed == m_cbSize
                        || RT_FAILURE(rc))
                    {
                        closeInternal();
                    }
                }
            }

            break;
        }

        case Directory:
        {
            rc = VINF_SUCCESS;
            break;
        }

        default:
            rc = VERR_NOT_IMPLEMENTED;
            break;
    }

    LogFlowFunc(("Returning strSourcePath=%s, rc=%Rrc\n",
                 m_strSrcPath.c_str(), rc));
    return rc;
}
示例#10
0
void WebSocket::close(unsigned short code, ExceptionState& exceptionState)
{
    closeInternal(code, String(), exceptionState);
}
示例#11
0
void WebSocket::close(unsigned short code, const String& reason, ExceptionState& exceptionState)
{
    closeInternal(code, reason, exceptionState);
}
示例#12
0
ScriptPromise ReadableStream::cancelInternal(ScriptState* scriptState, ScriptValue reason)
{
    setIsDisturbed();
    closeInternal();
    return m_source->cancelSource(scriptState, reason).then(ConstUndefined::create(scriptState));
}